Hello all, I am trying to get clarification on a question I asked some time ago about colliders and performance. I got some different answers the first time around that seemed to conflict with each other (that might be because I didn’t explain things well).
My game consists of a bunch of objects that are constantly moving. The background graphics are all hittable and they are constantly moving from right to left. I’m not using any physics - just directly manipulating the positions of transforms. Because there is no physics, I use kinematic rigidbodies for collision detection.
When I originally asked about colliders, I was told that I don’t need rigidbodies on both objects that would collide - only on one of them. So I removed a bunch of rigidbodies, and now, only my bullet objects have kinematic rigidbodies. So for example, when a bullet hits a background, I have:
- moving bullet: collider with kinematic rigidbody
- moving background: collider only (turning it into a static collider)
My question is: would this not create a performance hit? The documentation states: “In general, you should not reposition static colliders by changing the Transform position since this will impact heavily on the performance of the physics engine”.
The backgrounds don’t need to move as a result of the collision - they are always moving regardless of whether or not they have been hit with a bullet.
So I am confused - I removed rigidbodies, but do I need to re-add them?
My original post is here: Are my kinematic rigidbodies slowing my scene down? - Questions & Answers - Unity Discussions
Many thanks in advance for all answers and insights!