unity reset rigidbody velocity 1

unity reset rigidbody velocity

GetComponent().velocity = Vector3.zero;
GetComponent().angularVelocity = Vector3.zero;

Here is what the above code is Doing:
1. We’re getting the Rigidbody component of the object this script is attached to.
2. We’re setting the velocity of the Rigidbody to zero.
3. We’re setting the angular velocity of the Rigidbody to zero.

Similar Posts