- Home /
What do the "active" and "static" checkboxes do?
Hi,
I can't find a thorough explanation of what these two buttons do.
I thought when adding a RigidBody and turning Static off, I would get a rigidbody that stays still, but it doesn't! It still falls down. (how do I create a static rigidbody?)
So what are these buttons for exactly?
Active seems to hide the gameobject. But are theseg gameobjects then really GONE or just not being rendered? Can I still use the objects in my script if they are inactive?
Thanks, Nick
Answer by Mike 3 · Feb 04, 2011 at 10:42 AM
Active is for pretty much disabling the object and moving it away from the scene - Find won't find it, etc
Static is for occlusion culling, batching and lightmapping ( http://unity3d.com/support/documentation/Components/class-GameObject.html )
To make your rigidbody "static", click the Is Kinematic tickbox for the rigidbody itself. That will stop the rigidbody from responding to physics, and will only move or rotate when you tell it to with Rigidbody.MoveRotation and MovePosition
when Static is turned on you will not be able to alter anything on the transform in runtime, so if the Static check box is checked the rigidbody should stay in one place, $$anonymous$$inematic or not.
Senhor - that's not the case though. Rigidbodies do move with the static box ticked, as does moving the transform.
Sorry. $$anonymous$$y bad. Should learn to test stuff before posting. :)
While it's true that the static checkbox won't affect whether a rigidbody can move, it will affect whether you should allow it to move - objects marked as static should not be moved, be it by physics or by setting position/rotation manually.
Your answer
Follow this Question
Related Questions
GameObject Static & Active Flags 1 Answer
how can i get a pause screen to work 0 Answers
If you disable a gameobject, does an InvokeRepeating loop end or pause? 3 Answers
How to find Inactive GameObject 16 Answers
gameObject.active still draws object 3 Answers