Disable Rigidbody

I made a throwable bomb. It is take 3 seconds for the bomb to explde and a bit more time for the exploding progress untill it disappier. When the exploding progress begins, the bomb should not be affected by gravity anymore or by any other object and don’t move at all.

The problem is that the bomb keeps moving when the exploding progress begins and bing affected by other objects, I succseed to disable the gravity but the bomb keeps moving siadways.

How I disable it’s movment or rigidbody?

Sorry for poor english.

number of possible different solutions:

when you trigger the explosion, you can:

rigidbody.sleep() //think this will work, but if something else interacts with it, then no.

or

rigidbody.velocity = Vector3.zero;
rigidbody.enabled = false;

or

when you trigger the explosion, destroy the bomb and have the explosion be a different game object that you instantiate from a prefab

If you want the bomb to stop moving immediately, try the following steps:

  1. Set the bomb rigidbody’s velocity to 0
  2. Set the rigidbody’s angularVelocity to 0
  3. Set the rigidbody’s isKinematic to true. This should stop it from being affected by the physics engine.

There may be a “better” way to do this; I don’t have a lot of experience with rigid bodies. But give this a shot and see if it works.