Game Development Reference
In-Depth Information
4.1 Gravity and Collision Detection
In previous chapters, we were able to simulate gravity by setting a ground reference and
moving the towards it as the time goes. In this chapter we make advantage of built-in phys-
ics simulator in Unity. To apply physical characteristics to an object, we need to add two
components: Collider and Rigid Body . All basic shapes in Unity have colliders by default.
For example; if you add a sphere object, you can notice that it has a Sphere Collider com-
ponent attached to it as in Illustration 43.
Illustration 43: The Collider component
Search WWH ::




Custom Search