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 Guliz · Mar 28, 2017 at 12:25 PM · rotationlimithingejoint2dangular

Rotating hinge joint over 180° with angular limit

http://imgur.com/ZBD24rE

When rotating a hinge joint with angular limit it will flip at 180° around the rotation anchor point. On the start object (pentagon) is a script attached.

     Update(){
            rigidbody.moveRotation(Time.time * 100);
     }

Is there a solution to this problem? The the rotation of the start object switches from 180 to -180. It's maybe a direction for a solution

alt text

2017-03-26-0415.png (14.2 kB)
Comment
Add comment · Show 6
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 MarshallN · Mar 28, 2017 at 04:23 PM 0
Share

It'd be awfully hacky, but you could make a hinge joint that's the child of another hinge joint object and have the two angles sum to your total angle.

avatar image Guliz MarshallN · Mar 28, 2017 at 04:55 PM 0
Share

Thx $$anonymous$$arshall for your reply. I kinda get what you want to do but i think the outcome will be the same. But i thought of another solution by reading your suggestion.

The problem is that the hinge joint checks the rotation of the anchored object (start, parent). When that anchored object rotates over 180°, the rotation will become -180° and the joint thinks "my rotation is too far off from my parents, i have to adjust". At this very moment i have to set the joint rotation + or -360°.

I didn't found a way to set the rotation by now. Found this: http://answers.unity3d.com/questions/39797/rotate-a-hinge-at-runtime-using-script.html Gonna check that out later.

avatar image Guliz MarshallN · Mar 29, 2017 at 08:23 AM 0
Share

When i invert the the joint rigidbody rotation at the time the anchored object switches from 180 to -180 the behavior is wierd. It won't flipe like http://imgur.com/ZBD24rE but the manually adjusted rotation jumps from lets say 137° to -149°. I tried different things. Transform.rotation, Rigidbody.rotation, AddTourque, useLimits, FixedUpdate, Update, rigidbodyType but nothing works well. I guess the joint physics aren't made to to interfere. :'(

avatar image dvandamme MarshallN · Mar 29, 2017 at 08:36 AM 0
Share

I make a lot of usage of joints and handling big angles is a right pest. ages ago, i got this

https://www.assetstore.unity3d.com/en/#!/content/14290

for one problem hinge, its way overkill, but that package is amazingly useful for making all joints work extremely well for exactly this kind of problem (among many others)

avatar image Guliz dvandamme · Mar 29, 2017 at 01:27 PM 0
Share

Hi dvandamme thanks for the suggestion, looks great. It's really a little bit an overkill for my small project. I try to avoid to have third party content in the project because i had some bad experience with plugins and for example new Unity Version, new Os version, support etc

I just created a empty project and made two objects: parent-rigidbody and the hingeJoint-child then add the rigidbody.roatete script. And guess what, it worked without problems. I will test it tonight in my project again.

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Guliz · Apr 01, 2017 at 02:36 PM

I really don't know what the problem was, but when i created new objects the problem was gone. Maybe it was because the old objects where instances of a prefab but i broke up the relation.

http://imgur.com/a/r8QP5

thanks for help and inputs.

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

how to limit rotation 2 Answers

I want to restrict the rotation with the following Script,I want to restrict tranform.Rotation 0 Answers

Limiting rotation of object, specifically using scroll wheel 2 Answers

How to limit the rotation of an object 2 Answers

Limiting rotation of an object 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