• 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
4

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 4 · 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 My 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
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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

103 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

Related Questions

Violent shaking when using position drive in Configurable Joints 1 Answer

Components jittering - Configurable joints 0 Answers

Getting a configurable joint to point at another object 2 Answers

Set ConfigurableJoint TargetRotation, TargetAngularVelocity, TargetPosition and TargetVelocity, to match another transform. 0 Answers

Configurable Joint attaches at different points 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges