This question has been asked in a few forms over the years but the answers vary and there doesn’t seem to be any common understanding of the “right” way to do this.
Suppose you have a 3D game and you want to prevent objects clipping through one another but otherwise don’t need any physics simulation.
Is there a canonically correct way to approach this? If not, what are the pros and cons of using RigidBody vs. scripting the collision detection manually?
Static objects don’t collide with each other, neither do kinematic rigidbodies.
So every solution to this will involve a trigger collider (the only non-physical way to detect collisions between two objects) and thus it will require a rigidbody (trigger colliders cannot be added to static objects).
The only choice is whether to use kinematic or physical rigidbodies. This really comes down to if you prefer applying forces which involve realistic movement like momentum, or lerp movements which allow you to specify the exact motion on a custom frame by frame basis. Without any non-trigger colliders, a physical rigidbody is otherwise the same as a kinematic one.
I do non physical collisions in Unity all the time using ComputePenetration. Works perfect. Its because I needed to work with Physx colliders as normal but also do my own thing.