- Home /
Rigidbody2D won't stop moving.
I move my gameobject between waypoints/breadcrumbs by alterning its rigidbody2D's velocity like this:
this.rigidbody2D.velocity += acceleration;
this.rigidbody2D.velocity = Vector2.ClampMagnitude(this.rigidbody2D.velocity, this.speed);
Then, when it gets to the last waypoint/breadcrumb I do this:
this.rigidbody2D.velocity = Vector2.zero;
this.rigidbody2D.angularVelocity = 0.0f;
this.rigidbody2D.Sleep();
I've also set sleeping velocity in project's physics properties to 0. Even though I did all of this - my objects still moves at some really small velocity. What should I do to stop it completely?
Is he the child of something else? Also note that by setting sleep velocity to 0 you're basically ensuring that nothing will go to sleep unless you explicitly set it's velocity to 0 and dont have any forces acting on it.
do you using physic material 2d (or physical) for the ground or something? Set physic mat. to: 1 (0 = ice effect, 1 = fast stop effect)
Answer by MrSoad · Oct 20, 2014 at 06:29 PM
Try setting :
rigidbody2D.isKinematic = true;
It is enabled, just like fixedAngle. I also set interpolate to none.
Odd, normally setting this to true will stop an object dead, it should stop the physics engine doing anything with the object...?
Answer by Xavier78 · Dec 12, 2018 at 08:05 AM
I had to set Linear drag to 10 when Body Type is set to Dynamic, on Rogidbody2D.
Your answer
![](https://koobas.hobune.stream/wayback/20220613165519im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Do rigidbodies (especially 2d) have limits on their velocities? 1 Answer
Ignore sub-colliders for center of mass in Rigidbody2d? 1 Answer
Slow Down the ball speed in every collesion 1 Answer
increasing knockback of a rigidbody as received damage increases (like super smash) 1 Answer
Unexpected "Jumping" Behavior 0 Answers