November 2019
Intermediate to advanced
404 pages
12h 9m
English
When the physics engine processes a given timestep, it must move any active Rigidbody objects (GameObjects with a Rigidbody component), detect any new collisions, and invoke the collision callbacks on the corresponding objects. The Unity documentation makes an explicit note that changes to Rigidbody objects should be handled within FixedUpdate() and other physics callbacks for precisely this reason. These methods are tightly coupled with the update frequency of the physics engine as opposed to other parts of the game loop, such as Update().
This means that callbacks such as FixedUpdate() and OnTriggerEnter() are safe places to make Rigidbody changes, whereas methods such as Update() and coroutines yielding ...
Read now
Unlock full access