Game Development Reference
In-Depth Information
Colliders use the game object model's volume to detect whether or not an impact with another game
object has occurred. At least one of the involved game objects must have also have a Rigidbody
component attached for them to react physically with each other in the game world space.
Triggers are used in scripts for detecting collisions in order to initiate game events other than
physical interactions that are managed through code. When two game objects touch, data about the
objects is generated that can be used in a variety of ways to affect gameplay, but the game objects
do not appear to interact physically.
When used as a collider in physical interactions where at least one game object also has a
Rigidbody component attached, the Physic Material attached to the Material property affects the
way the physics engine determines the collision behavior. For example, a Physic Material might give
the game object more or less “bounciness.”
A collider does not have to match the shape of the game object it is attached to. Simple collider
shapes can also be put together and used for a more complex 3D model. The Center and Size
properties are used to position and scale this collider relative to the game object model. You will
learn more about colliders, triggers, Physic Materials, and the physics engine in Chapter 6.
 
Search WWH ::




Custom Search