- Home /
Question by
Thorlar · Jul 25, 2018 at 01:34 PM ·
rigidbody2dcollider2d
When you disable a gameobject, what happens to the rigidbody inside?
Asking for performance reasons, I just wanted to know if it is wise to Sleep the rigidbody(2D) right before disabling the gameobject inside, or if the Disable, aka SetActive(false) does it automatically, since I'm about to have multiple gameobjects that enable/disable often.
Also, if I sleep a rigidbody(2D), will its colliders be active in the simulation? (triggers or not) Like, will the colliders be evaluated inside the calculations, but ultimately ignored?
Comment
Best Answer
Answer by NorthStar79 · Jul 25, 2018 at 01:45 PM
No, you don't need to sleep or disable rigidbody before deactivating game object.
Physics system will stop simulating them after first "FixedUpdate" call.