Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 DerLasseHenrich · Jun 18, 2019 at 09:32 AM · rigidbody3dgravityhingejointfriction

Prevent rigidbody with hinge joint from slowing down

I created this model: alt text The log swings around its support. This support is the parent object of the log and has no Rigidbody and just consists of a mesh. The log has these components which are used for the swinging: alt text You may see that it doesn't use gravity, so I simulated gravity with this line of code:

 rigidbody.AddForce(direction * 9.81f);

"direction" is just the vector which points towards the stone path, so basically down

So here is my problem: The log is slowing down. It doesn't just swing there forever, instead its speed gets less and less, like if it's affected by friction. Its rigidbody already has angular drag set to zero, so I honestly don't know what causes this. If you have any idea, please let me know. Thanks!

logslowing.png (402.5 kB)
logcomponents.png (44.9 kB)
Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by metalted · Jun 18, 2019 at 08:19 PM

Well its doing exactly what you tell it to do right? Aside from the changed gravity direction its the same as any other swinging log. The force will pull it towards the earth and at some point it will stay there. Just like a regular pendulum on earth. If you want it to keep swinging you should add some force to it, just like a swing set. You could of course also fake it. Just because a log swings with a "hinge joint" in the real world doesn't mean it has to do it in your game. You could also just rotate the log around its pivot point using a Mathf.Sin or a pingpong function. It will do exactly the same as you want it to do with the rigidbody, with less of the hassle of joints and rigidbodies.

Comment
Add comment · Show 3 · 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 DerLasseHenrich · Jun 18, 2019 at 08:22 PM 0
Share

Actually that's no bad idea to just fake it. I am gonna try with this one, thank you!

avatar image metalted DerLasseHenrich · Jun 18, 2019 at 08:27 PM 0
Share

Yeah rigidbodies and joints are really tricky. They can break, they can shift apart, fixed joint are not really fixed and can become loose under the weight. In most cases when I wanted to achieve an effect in my scenes, I would be stuck in a way how it works in the real world and try to copy that. But most of the times, I would resort to a simpler solution of just translation and rotation and I would get the same effect. But it always hard to deter$$anonymous$$e if you really need rigidbodies or not.

avatar image DerLasseHenrich metalted · Jun 18, 2019 at 08:29 PM 0
Share

Exactly, I also had some hard times with joints in some of my other games. Sometimes you're better off without physics :D

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

172 People are following this question.

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

Related Questions

A position locked hinge joint with drag and no gravity? 1 Answer

How to have a sphere roll/be affected by friction 0 Answers

Physic Torque Hinge joint problem 0 Answers

Faux Gravity help 0 Answers

How to add gravity without a rigidbody 2 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