Implementing environmental physics
The main problem with our level, as it stands, is that it lacks interactivity. If we dragged and dropped a player object into the level and pressed play on the toolbar, the player would fall through the floor and walls because Unity doesn't recognize the foreground texture as a solid object. It's just a texture and exists only in appearance and not in substance. In this section, we'll correct this using Physics and Colliders. To get started, we'll create a player object (not the final version but just a temporary White Box version used only for testing purposes). Let's get started:
Generate a capsule object in the scene by navigating to GameObject | 3D Object | Capsule from the application menu.
- Once generated, remove the Capsule Collider from the object by clicking on the three dots icon on the Capsule Collider component in the Inspector window and choosing Remove Component from the menu, as shown here: