I have a camera with a few colliders attached to it that flies around throughout the scene. It's a little jumpy, and when investigating it in the profiler, I found it was doing static collider moves. My object contains box colliders (none static), but no rigidbodies. Somehow Unity is considering this a static collider move and grinding my performance. Is there any way around this?
Please see the related forum post: http://forum.unity3d.com/threads/75560-Unity-is-creating-static-colliders-on-load.
In the above post, there was mention of removing rigidbodies from child objects to work around this issue, but since I don't have rigidbodies, I cannot follow this advice. I DID try adding a kinematic rigidbody to the camera, which did fix the problem, but slowed my game down to a crawl.
Does anyone have any suggestions? I need to get this fixed asap!
asked Oct 26 '11 at 04:05 PM
"Static Collder" refers to any collider without a Rigidbody. Since you said that you don't have Rigidbodies, you have static colliders.
Basically, in PhysX, everything which is expected to move needs to have a Rigidbody. If you don't want physics simulation to move the object, just set the kinematic flag in the Rigidbody. Colliders without a Rigidbody are expected to stay in place, and are organized in a big data structure for finding colliders in the world quickly - this data structure needs to be rebuilt when you move the collider, thus the performance hit. Besides, the simulation tends to be more stable when you use kinematic Rigidbodies on colliders you move around.
answered Oct 26 '11 at 06:15 PM
jonas echterhoff ♦♦