a rigid body without physics?

hello, i have a situation were i need an object to collide with another object and the two to just stop and do nothing. as in, not to bounce away from each other but not pass through each other.

i have the two objects with box colliders, one kinematic and one not. i learnt that if both are kinematic they just pass through each other. So is there a way to have both objects kinematic, and so not affected by physics, but not to pass through each other?

thanks in advance! might be a noobish question

Physics is what they made to not pass through each other. If you control the objects yourself (kinematic rigidbodies) there’s nothing what the collision system could do when you move one into another. Physics can apply forces to prevent intersection.

What you can do is to turn the collider into trigger. Then you can check for collisions yourself.

A Rigidbody represents a physics object nothing else. A kinematic rigidbody is just a tool that allows one-way physics interactions.


It should also be possible to use Rigidbody.SweepTest or Rigidbody.SweepTestAll with kinematic rigidbodies. It just simulates the movement and tells you if and where it would collide but doesn’t move it actually. That way you can handle the collisions the way you want.

You could always check for collision via raycast, trigger, or any other relevant method, and then if it’s detected, zero out your velocity. That would probably be the simplest method.