Hey guys,
a, hopefully, short and easy question this time. Ive been going thought the documentation on Rigidbody but I cannot seem to find an easy way to remove all velocity on a gameobject.
I've tried, of course, setting rigidbody.velocity to zero. This just seems to add zero to the current velocity though.
What I want is to respawn an object, which works, but I want all old velocity removed, how would I do this easily?
Edit for future reference:
Using rigidbody.velocity = Vector3.zero; does reset the velocity, but remember to also use rigidbody.angularVelocity = Vector3.zero to remove the spin.
You are right. When this object goes out of bounds I set it's transform to a 'respawnposition'. I've tried setting velocity to zero and I'm not manipulating it through script elsewhere, but I'll try it again. o.O maybe I did something wrong. Thanks for the help.
– anon73820239I think I figured it out. When I reset my object's transform and set it's velocity to zero it maintains it's current spin, causing it to move upon 'respawn'. Thanks for all the help.
– anon73820239