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
1
Question by Static-Dynamo · Feb 10, 2017 at 09:52 PM · physicsjointsjointconfigurablejointconfigurable joint

Joint system scale problems

Hello! I'm having some issues with a joint system I built and I can't figure out how to troubleshoot or fix it.

I have a hand I set up to be an active ragdoll, the joint system has a parent object to make it easy to move it around as a whole.When I hit play it looks like this- https://i.gyazo.com/d51ce9c4cedd1ca35552d28bd9d06264.gif

It's not perfect but it works well enough for now. However, when I scale my parent object to be smaller the entire behavior of the joint system changes. When I scale it smaller and hit play the same exact system with 0 changes behaves like this- https://i.gyazo.com/b2030833ec5641e79a2c711a367592a1.gif

I am using configurable joints and capsule colliders. The configurable joint contains an option for "Configured in World" which is toggled to false. There is no script or code on this object. If you have any ideas on how to fix this I would greatly appreciate it. Thank you

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
8

Answer by RichardRevesz · Sep 25, 2018 at 01:24 PM

Dude, I have been struggling this for a while now, and finally I have figured it out. Not sure if you still need it, but here it is anyways.

So the problem seems to be that the physics system calculates the anchors and connected anchors at the start, but does not update them later, which is fine, as long as the scale is the same.

But when you scale it, the joint system stays at the original size thus the model falls apart.

What you need to do is save the anchor and connected anchor positions, and update it whenever you scale it. (It is in local space, so no need to scale it).

Don't forget to disable Auto Configure Connected Anchor!!

My script does it in every update:

 Transform[] children;
 private Vector3[] _connectedAnchor;
 private Vector3[] _anchor;

 void Start()
 {
     children = transform.GetComponentsInChildren<Transform>();
     _connectedAnchor = new Vector3[children.Length];
     _anchor = new Vector3[children.Length];

     for (int i = 0; i < children.Length; i++)
     {
         if (children[i].GetComponent<Joint>() != null)
         {
             _connectedAnchor[i] = children[i].GetComponent<Joint>().connectedAnchor;
             _anchor[i] = children[i].GetComponent<Joint>().anchor;
         }
     }
 }


 private void Update()
 {
     for (int i = 0; i < children.Length; i++)
     {
         if (children[i].GetComponent<Joint>() != null)
         {
             children[i].GetComponent<Joint>().connectedAnchor = _connectedAnchor[i];
             children[i].GetComponent<Joint>().anchor = _anchor[i];
         }
     }
 }

I hope you find it useful. Best, Richard

Comment
Add comment · Show 5 · 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 dirkmcpherson · Jun 25, 2019 at 07:50 PM 1
Share

you are great.

avatar image Kudorado · Dec 04, 2019 at 03:56 AM 0
Share

great, work perfectly.

avatar image basaroguz · Jul 13, 2020 at 02:45 PM 0
Share

Thank you so much! Great work.

avatar image jrpaglu · Dec 30, 2020 at 02:07 PM 0
Share

Thank uh ! Its Working Now I can Change $$anonymous$$y Active Ragdoll Scale Runtime One change : Called Update Block only once Whenever You Change the Scale You do not need to Calling it Continuedly

avatar image jamwitk · Jul 11, 2021 at 09:16 AM 0
Share

year 2021 still works thank you man

avatar image
0

Answer by FortisVenaliter · Feb 10, 2017 at 09:59 PM

When you scaled your hand, did you scale the mass in the rigidbody(s) to match?

If you don't, the forces (particularly gravity) will appear to have a larger magnitude.

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 Static-Dynamo · Feb 10, 2017 at 10:34 PM 0
Share

I currently have the rigid bodies set to not use gravity. So that shouldn't be an issue. Also I didn't think the forces would be different since I have the configurable joints set to work in local space.

I attempted the scaling of the rigidbody mass as you suggested, to match the overall decrease in scale of the parent transform. However the behavior is exactly the same as when the mass was not changed.

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

104 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

Related Questions

How can I make a configurable joint behave like a spring joint? 0 Answers

Violent shaking when using position drive in Configurable Joints 1 Answer

Getting a configurable joint to point at another object 2 Answers

Configurable Joint attaches at different points 0 Answers

How target rotation and target angular velocity work in configurable joint ? 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