Preventing falls - collision

We don't want to have players always be stuck in walls, but we also want to make sure they don't fall down into the void. We can fix this problem with the addition of colliders:

  1. Select our "bridge" between the two areas and duplicate the object by hitting Ctrl + D. Reduce the newly created object's width to 1 unit and have it go up to be 3 units tall.
    Preventing falls - collision
  2. Switch back to the Object mode, duplicate the object, and then move it to the other side.
  3. Select both the objects and, in the Prototype panel, click on the Set Collider button.

    You'll notice that there is now some nice semitransparent boxes in the areas where our full boxes ...

Get Building an FPS Game with Unity now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.