Working with colliders
As you may have noticed, the player walks on the floor that we placed in Chapter 1, Getting Started with Unity and Firebase. If you are a little naughty, you may also have noticed that if your player leaves the floor, he will fall into the void. This is explained by the fact that the floor that we placed is a plane. By default, this type of geometry comes with a component called Mesh Collider, which serves as a physical barrier so that any object that is placed on top does not fall into the void.
In order for one object not to fall through another or not to be passed through, both objects must each have a collider component. If you noticed earlier, when we created our player controller, a green capsule appears around the character. This capsule is nothing more and nothing less than a type of collider (Capsule Collider). By default, Unity includes one for us in our player.
Let’s do another test to learn more about how colliders work:
- Place...