Hello,
I want to have an offset (-90 on z) on the rotation. How can I do that?
This is my script:
public class CopyMotion : MonoBehaviour
{
public Transform targetLimb;
public bool mirror;
ConfigurableJoint cj;
// Start is called before the first frame update
void Start()
{
cj = GetComponent<ConfigurableJoint>();
}
// Update is called once per frame
void Update()
{
if (!mirror)
{
cj.targetRotation = targetLimb.rotation;
}
else
{
cj.targetRotation = Quaternion.Inverse(targetLimb.rotation);
}
}
}
Thanks for help!