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
4
Question by SBull · Mar 04, 2015 at 08:23 PM · unity 5javascriptunity5hingejointupgrading

Hinge Joint not working in Unity 5

I just upgraded from Unity 4.5 to 5 and everything is looking good except the hinge joint in my scene is behaving differently than it used to. I was using it to simulate a spring board using a script. When the player clicked on a object and dragged it back, the script would interpolate that distance the player dragged and set the max angle of hinge joint to seem like it was being pulled down. Then when the player released, it would reset the max angle so that it would spring up.

However after upgrading, the hinge joint snaps all the way back as soon as I hit play and won't move at all. I also notice a message in the Inspector that wasn't there in the previous version. It says "Max Limit needs to be larger or equal to the Min Limit." That makes sense since my Min is 45 and my Max is 0, but that is the value that made it work the way I needed it to previously so I'm confused why it won't work now.

Here is the script I have attached to the hinge joint object:

 private var minAngle : float;
 private var maxAngle : float;
 var tracker : Transform;
 var launchPivot : Transform;
 
 function Update()
 {
     //Calculates the distance between both objects
     var dist = Vector3.Distance(tracker.position, launchPivot.position);
 
     //Interpolates angle of object dependant on distance of two objects
     var angle : float = Mathf.Lerp(maxAngle, minAngle, dist/5);
     
     //Changes angle of object by limiting hingeJoint max limit property
     GetComponent.<HingeJoint>().limits.max = angle;
 }

Any help is appreciated. Thanks.

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 SBull · Mar 05, 2015 at 08:34 PM 0
Share

I've tried changing a bunch of values and seem to get some results, but there are definitely some changes somewhere that I don't understand. I think I'm just going to revert to version 4.5 unless I can find some kind of explanation of what changed with the hinge joints.

avatar image Fanttum · Mar 15, 2015 at 03:18 AM 0
Share

Having a very similar issue :/ Will let you know if I can figure anything let, also will keep an eye on this.

avatar image GearsAD · Mar 22, 2015 at 03:36 PM 0
Share

Hi,

Same problem here - fundamentally the script changes are not being applied. I've tried in normal code sections and in FixedUpdate. Looks to be a bug?

2 Replies

· Add your reply
  • Sort: 
avatar image
5

Answer by aurelioprovedo · Mar 06, 2015 at 11:50 AM

I've also encountered problems with physics joints when upgrading to Unity 5. I believe that in the new PhysX version, joints are much more picky. Try doing these two things:

  • If the rigidbodies have position or rotation constraints on any axis, make sure that only the connected bodies (the dominating ones) have those constraints. If both rigidbodies have the constraints, the joint f*cks up for some reason.

  • Try disabling the Enable preprocessing checkbox, at the bottom of the joint component in the Inspector panel.

Good luck!

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 bac9i4mo · Apr 03, 2015 at 05:51 PM 0
Share

"If child rigidbodies have the constraints, the joint f*cks up for some reason."

Thank you, mate. You've just fixed my 2d ragdoll

avatar image elliselkins · Oct 31, 2016 at 04:14 PM 0
Share

Related to the constraints problem, I have a ConfigurableJoint and my prefab would get a bad collision and fly off when instantiated if the X Y and Z motions were set to Locked. I turned this to free, instantiated the prefab, then changed this to Locked and it worked.

avatar image
0

Answer by HakJak · Jun 08, 2015 at 07:50 AM

Not sure if it helps you, but one thing I've noticed is that joints now behave differently if you don't have colliders also attached to the game objects.

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

26 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

Related Questions

Unity 5.6 upgrade pains 0 Answers

Asset Bundle Dependencies, Unity 5 0 Answers

Trying to visually show the growth stages of a seed 0 Answers

Unity 5.3.3f1: How to set an object as AssetBundle by script? 0 Answers

How to create a secure package? 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