Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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
2
Question by eric_c · Mar 23, 2012 at 12:21 PM · javascriptphysicsjointfixedjoint

Fixed joint - not really fixed?

Hi, im trying to connect these series of cubes together as shown here :

link

The orange cube is fixed in its position, and all the other cubes (with gravity) are connected in a series of fixed joints. My problem is that the fixed joint don't really fix the objects in their positions, but rather "dangle" around like a spring, as shown :

link2

How do I achieve a really fixed positions with a physics joint for all the connected bodies without the dangling effect while still enabling its "use gravity" and "is kinematic" option? I'm using javascript if it concerns anything,Thanks!

Sorry for the pictures, coudn't figure out how to post them there.

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
10
Best Answer

Answer by reptilebeats · Mar 24, 2012 at 03:08 AM

Your best option what i use a lot for certain things is either turn the solver iteration count up in physics to make joints more solid, however this will add performance drain as it effecting every joint in game.

Or what i normally use is a configurable joint lock all and then at the bottom u will find projection turn this on for rotation and position and underneath set the limits to 0, u may also have to turn solver iteration up a little depending on your setting.

Remember setting this can make objects react differently, for example i made a bike game and the back wheel had to have a little room on the projection in order for the bike to have the right feel when applying forces.

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 eric_c · Mar 24, 2012 at 03:28 AM 0
Share

$$anonymous$$any thanks for saving my life! Turning the limits to 0 reduces the wiggling significantly, thanks!

avatar image LumpySpoon · Jul 06, 2015 at 02:31 PM 1
Share

Note : When changing solver iteration count, it only applies the new value on project start. I wondered why, when changing solver iteration count value, had no effect on my game, that is why.

avatar image
2

Answer by wborgo · Jun 03, 2013 at 10:09 PM

I know this question is a little old, but, if someone have the some problem, here is my solution:

  • Mark all the constraints in the object's rigidbody

  • Create a CS file called FixJoint.cs

  • Attach this script in the object.

The code to FixJoint.cs:

 using UnityEngine;
 using System.Collections;
 
 public class FixJoint : MonoBehaviour {
     void FixedUpdate () {
         if (!GetComponent<FixedJoint>())
         {
             rigidbody.constraints = RigidbodyConstraints.None;
             Destroy(this);
         }
     }
 }
 

What it does is simple: If your object have constraints it will not move, but the joint will work. So, it's check if the component is attached in your object, if not, it means that the joints have broken, so, the script will clean the constraints. After this, the script will destroy itself, cause it is not usefull anymore.

Sorry for my english, it's not my native language. William Borgo.

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
avatar image
1

Answer by valeracogut-datasakura · May 16, 2020 at 04:15 PM

  • 1st solution for this problem is to separate fixed joint physics and its graphics

  • 2nd solution - if you cannot separate joint from graphics you can also make your joint stronger by adding new one on the same object :-)

hope these two hacks will help in your projects!

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
avatar image
0

Answer by Statement · Mar 23, 2012 at 03:14 PM

Add the objects as children. This will make them "rock solid" as they will not bend, rather rotate the entire object if it gets too heavy. In this scenario you shouldn't keep the rigidbody on the child objects.

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 eric_c · Mar 24, 2012 at 01:18 AM 0
Share

I want the objects to be individuals ins$$anonymous$$d of being a parent/childrento other objects, is there any alternative besides adding them as childrens?

avatar image Bunny83 · Mar 24, 2012 at 02:27 AM 0
Share

physics-simulations always need some "room" to operate and handle forces. Even in the real world every material does slightly bend / move in order to transfer / absorb forces. Simulating physics isn't an easy task since the simulation happens only at fix timesteps.

You can try another joint type (ConfigurableJoint), but as already said it will never be "fix" like a parent-child-relationship.

You can keep the child rigidbodies if you make them kinematik in the case you unparent them later.

You could also try to disable the gravity on all rigidbodies so you don't have the bend-effect. If a joint breaks you could enable the gravity of the individuals to make them fall down.

avatar image
-1

Answer by gooncorp · Jun 02, 2014 at 06:10 PM

I'm pretty sure the configurable joint is broken. When you go too fast with 2 joints they always drag behind even if you set all the values to LOCKED, this is broken in my opinion. When you have to write a script that does what those LOCKED settings should have done in the first place something is def wrong.

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

8 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Calling OnJointBreak on Connected body 1 Answer

How target rotation and target angular velocity work in configurable joint ? 1 Answer

2D 360 degress platformer example needed 0 Answers

How to name a physics joint, and refer to it? 1 Answer

Reducing the distance between 2 objects in a hinge 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