How to transmit the correct rotation (quaternion) to an configurable joint?

Hi guys.
I want to transmit a localRotation of a gameObject to the targetRotation of an configurable Joint.

This is the way I tried it:

private var NewRotation : Quaternion;
NewRotation = sourceGameObject.transform.localRotation;	
targetGameObject.GetComponent(ConfigurableJoint).targetRotation = NewRotation;

It almost seams to work, but there is always at least one axis mirrored. I tried any thinkable combination with the Axis and Secondary axis value in the configurable joint input mask. What do I wrong ? - I quite desperated.

(You have to know I’m just started to learn scripting)

1 Answer

1

I finally found a solution :slight_smile: This nice guy released a script to fix this issue. Visit this thread: http://forum.unity3d.com/threads/8919-Quaternion-Wizardry-for-ConfigurableJoint

I just put that script into a javascript function, just because I even have less skills in CS than in JS.
Now I’m able to sleep again :slight_smile:

How do you put "that script into a javascript function"? Could you clarify?