Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by dcf · Oct 20, 2014 at 05:19 PM · physicsrigidbodyrigidbody2d

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?

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image smoggach · Oct 20, 2014 at 05:18 PM 0
Share

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.

avatar image dcf · Oct 20, 2014 at 05:45 PM 0
Share

No, the object is standalone.

avatar image gosc · Oct 21, 2014 at 12:32 PM 0
Share

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)

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by MrSoad · Oct 20, 2014 at 06:29 PM

Try setting :

 rigidbody2D.isKinematic = true;
Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image dcf · Oct 21, 2014 at 12:26 PM 0
Share

It is enabled, just like fixedAngle. I also set interpolate to none.

avatar image MrSoad · Oct 21, 2014 at 01:37 PM 0
Share

Odd, normally setting this to true will stop an object dead, it should stop the physics engine doing anything with the object...?

avatar image
0

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.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

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


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges