• 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 msable · May 29, 2015 at 05:21 AM · physicshingejointmotor

Trying to turn on a motor on a hinge joint. Won't start moving until I change a value in the inspector.

I have a Hinge Joint. In a script, I set "Use Motor" to be true when I click on the motor. I see in the inspector that this value does get set correctly. Even though this value is set, the motor doesn't actually do anything unless I change some value on the Hinge Joint in the inspector. It can be anything; I can change the target velocity/force/free spin of the motor, or just set "Enable Preprocessing" to be true/false on the hinge joint itself. Once I do anything like that, the motor will actually start working. I've tried changing one of these values in code, but it doesn't do anything. I'm at a loss. Why is this happening, and what can I do to fix it?

Also, I've seen this answer in several different threads, but it isn't working for me:

I've also encountered this and devised a workaround. I'm not sure, but it seems like changing the constraints of a joint do not cause the physics engine to calculate a solution for the scene. By "prodding" the object whose joint's constraints have been changed, you can force a solution. For me, after changing the constraints of a joint, I called AddForce(Vector3.zero) on the object's rigidbody. This caused the new constraints to be enforced.

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

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Ellis · Jun 19, 2015 at 06:55 PM

Wish I could awnser this but I'm searching for the exact same awnser...

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
avatar image ChocolatePinecone · Jul 31, 2015 at 02:56 PM 0
Share

I have had the same problem. With AddForce also not being a workaround. Switching the $$anonymous$$inematic setting on and off worked as a workaround for me.

avatar image
0

Answer by spinaljack · Mar 16, 2021 at 03:11 PM

Make sure the rigidbody isn't sleeping:

 if(rigidbody.IsSleeping()) rigidbody.WakeUp();

Comment
Add comment · 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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Hinge Motor Stuck After Hitting Limits 1 Answer

Hinge Joint Motor Force Units? 0 Answers

How do you attach moving parts (moved by physics) to an animated character? (Secondary Animations) 1 Answer

Rubbery hinge joints 1 Answer

How to limit the motion direction of a GameObject? 1 Answer


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