Environment Physics
The main problem with our level as it stands is that it lacks interactivity. Specifically, if we dragged and dropped a player object to the level and pressed play on the toolbar, the player would drop through the floor and walls because the foreground texture isn't recognized by Unity 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 temporary player object (not the final version but just a temporary White Box version used only for testing purposes). To create this, generate a capsule object in the scene by navigating to GameObject | 3D Object | Capsule from the application menu. Set the Z position of the transform to match the foreground texture (for me, this is -2
). Once generated, remove Capsule Collider from the object. By default, the Capsule is assigned a 3D collider (such as the Capsule Collider), which is useful primarily for...