- Home /
RigidBodies vs CapsuleCasts
I've been tinkering with the Physics.CastAll functions to avoid the "costly" rigidbodies. After several rigidbody work-arounds (getting things to work without them) I've been debating whether to just put them in my game.![alt text][1]It's a Zelda Ocarina Of Time lookalike. So there wouldn't really be that many rigidbodies that need calculated for, but I want it to be playable on older machines.
So my question is this. Is using rigidbodies worth the performance cost? And how much is that cost compared to (say) CapsuleCastAll every step?
You mean you want to run your own code for "physics" movement and collisions? OverlapSphere or a short CapsuleCast would be used in your hand-written Collision tests?
Yes. I would like to know if a self coded "physics" code would be faster that just using a CharacterController and having that calculate collisions.
CharacterControllers are much slower than rigidbodies. Rigidbodies manage all the physics, making it much much easier to code for, but if you can model all the behaviour you need with raycasts do that ins$$anonymous$$d (since it'll be more stable anyway if you code it right).
So in order of speed (CPU usage) its, raycast (although caspsule cast sends many rays...) rigidbody, CharacterController. Alright. thanks for the help guys.