• 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 Cynicalized · Apr 03, 2010 at 04:54 PM · physics

Non-Springy Configurable Joint

I'm using configurable joint to connect two rigidbodies. My code is :

ConfigurableJoint joint = parent.AddComponent<ConfigurableJoint>();
joint.anchor = new Vector3(0, 0, 0);
joint.xMotion = ConfigurableJointMotion.Locked;
joint.yMotion = ConfigurableJointMotion.Locked;
joint.zMotion = ConfigurableJointMotion.Locked;
joint.angularXMotion = ConfigurableJointMotion.Locked;
joint.angularYMotion = ConfigurableJointMotion.Locked;
joint.angularZMotion = ConfigurableJointMotion.Locked;
joint.targetPosition = new Vector3(0, 0, 0);
joint.connectedBody = child.rigidbody;

This joint just behaves like a spring joint. I want to make it less springy or totally fixed.(I know the fixed joint but later i'll free some of the angular and linear motions)

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

5 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by duck · Apr 03, 2010 at 10:06 PM

As far as I'm aware, there will always be some springyness, even in fixed joints and config joints which have all locks applied. This seems to be an inherent symptom and limitation of the type of physics computation that PhysX uses.

You could try reducing the mass of one of the objects (whichever is not having forces applied), if this fits with your scenario.

However, I think it may be that the only way to ensure two objects are perfectly 'locked' together, would be to parent one to the other, and remove the rigidbody component of the child - therefore forming a Compound Collider. Only certain types of colliders can do this, however.

(see the section headed "Compound Colliders" on this manual page)

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 Jean-Fabre · Nov 18, 2010 at 11:42 AM 0
Share

I could achieve a very solid chain of joints when solver iteration and time step settings is right.

http://forum.unity3d.com/threads/66871-Excavator-simulation

avatar image
1

Answer by Cynicalized · Apr 03, 2010 at 10:40 PM

Thanks for answer. I've tried to reduce the mass with no luck.

I'm using coumpound colliders for totally fixed bodies. But i don't want to totally fix the configurablejoint. All i want to do is to create a less springy behaviour on locked motion axises. I've tested All-Locked Configurable Joint(ALCJ) vs. spring joint vs. fixed joint. ALCJ feels nearly same as spring joint. But fixed joint looks rock solid.

I think the configurable joint is a base for all other joints and i can produce all other joints by configuring it right. Am i wrong?

Comment
Add comment · Show 6 · 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 Vectrex · May 20, 2010 at 05:16 PM 0
Share

btw avoid using answers to post comments. Use 'add comment' button

avatar image LS16BMX · Jan 08, 2012 at 12:04 PM 0
Share

your not wrong !

avatar image Bunny83 · Jan 08, 2012 at 01:36 PM 0
Share

@s$$anonymous$$diworkz: you woke this 1.5 years old question to post that 3 words as answer?... I've converted it into a comment.

avatar image LS16BMX · Jan 08, 2012 at 01:56 PM 0
Share

sorry it was a bit of a joke, i'll keep it to myself in future .....

avatar image TerraCo · Feb 12, 2015 at 05:38 AM 0
Share

Would have been funnier if you waited another 1.5 years to reply.

avatar image Innovine TerraCo · Mar 01, 2018 at 08:31 PM 0
Share

Yes, agreed.

avatar image
6

Answer by Vectrex · May 20, 2010 at 05:16 PM

You can try a combination of these

a) Set a higher physics framerate. In 'Edit/Project settings/Time/Fixed timestep" set this to a smaller value. This will increase stability and 'strength' while also being potentially a lot slower. 'FixedUpdate' will be called more often also. So be careful

b) Set the physics body iterations to a higher value. In 'Edit/Project settings/Physics/Solver Iteration Count" to something higher. This causes bodies to be more accurate with joints and in general. It helps with 'sponginess' on collisions too I think. 'FixedUpdate' will not be effected by this setting. All jointed bodies I think take on the highest connected bodies iteration count. This also can slow things slow a lot so keep an eye on the profiler. This is a global setting, but you can also selectively set body iterations individually in code. eg rigidBody.solverIterationCount = 10;

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 Jean-Fabre · Aug 27, 2010 at 10:38 AM 0
Share

Thanks Vectrex!, your answer should be ticked as valid really and go straight in the documentation as the Edit/Project settings/Time/Fixed timestep is exactly what is needed to tweak when all the rest of the physics settings are good ( like solver iteration), thanks again!! my complex rig is now truly 'Perfect'.

avatar image Jean-Fabre · Nov 04, 2010 at 08:08 AM 0
Share

Furthermore on that matter, I found that on mac I could increase the solver iteration count without real slow down on the physic simulation WHILE on windows ( at least on the machine I tested) going over 40 slow down the physics big time

avatar image
0

Answer by BillyBobBeavis · Dec 10, 2018 at 01:11 PM

I was trying to figure this out for quite some time. The only solution I could find to get the effect I wanted was to create reciprocal configurable joints for each object I connected. Meaning if I want to connect objects B and A then B will need a joint with A as it's connected body and A will need a joint with B as it's connected body. Then, I set the five Drive and Angular Drive Position Springs on both joints to 9999 or higher while keeping their Position Dampers at 0. The greater the difference between the Position Springs and Dampers the more solid the connection becomes. I would guess it's an intensive solution but the connection is sweet.

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 BillyBobBeavis · Dec 15, 2018 at 06:18 AM 0
Share

I just figured out that lowering masses and forces makes joints more solid in proportion to the reduction. This should be obvious but apparently it's not since I have not seen anyone else mention it.

avatar image BillyBobBeavis · Dec 15, 2018 at 05:22 PM 0
Share

Also, try changing "free" motion to "limited". It applies the limits, but leave all the limits at 0. That's likely a better solution than the first one I mentioned and easier too. I hadn't tried this before.

avatar image
0

Answer by Augis1980 · Mar 17, 2020 at 01:50 PM

If all objects in the chain are more or less similar mass, then it should'ne be springyu (with 0 values in all bounciness etc, and Motion locked, angular limited) , but if one of your objects is way heavier, you will have that wierd effect. So just change mass of all objects to similar.

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

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

2D 360 degress platformer example needed 0 Answers

Two Bone IK constraint with more than 2 bones on my arm. 0 Answers

HOW DO I USE RAYCASTHIT 2D???? 1 Answer

Strange physics behaviour with spring joints and side walls. 1 Answer

How to make Rigidbody.AddForce less delayed in Unity3D? 0 Answers


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