Unity Space Shooter – Chapter 8 – boundary collider

Create a boundary around the game play area so the shots can be removed from play after they fall off the field.

 

  1. Create a box larger than the play area
    1. Create Cube
    2. Scale it
    3. Make sure it has a box collider
    4. isTrigger is checked
    5. Remove the Cube(mesh filter)
    6. Remove the mesh renderer.
  2. Create script(to handle the trigger) DestroyByBoundary
  3. Edit and add the OnTriggerExit routine.  When triggered, it will destroy the other object.
  4. Easy