Stop object(ship) when hitting a collider

Hey, I want to stop a flying ship(Which I move with the keyboard) immediately when it hits a collider. I tried many things like using OnControllerColliderHit or OnCollision enter but nothing works, the ship just goes through the object. Only when my ship got a Rigidbody attached it works but then the ship bounces back and never stops moving(because it is in the air). Someone got a idea how to do this?

I hope everything is clear, english ist not my first language. Thanks :).

Add the rigidbody to enable collision.

Set an upper value for drag (in the rigidbody component) to avoid never stop moving.

Thanks for your answer :).
I changed the number of drag to 1*10^25(that should be enough^^) but the flying ship still does move a few minutes later, even if i fly after collision to a place where it can’t collide with something i change its position(not fast but still noticeable) :/.

EDIT: I forgot to change the Angular Drag also. Now it works fine. Thank you very much :slight_smile:

The ship only stops when the object it hits got a box collider. It goes through a object with a mesh collider on it. Is this a normal behaviour of rigidbodys?

Rigidbodies don’t handle collisions, thats what Colliders are for.

MeshColliders do not collide with other MeshColliders unless they are set to convex. Use primitive colliders for moving objects.

Thanks, it works fine :).