- Home /
Question by
cheadleand · Jul 21, 2015 at 09:07 AM ·
gameobjectconfigurablejointrotaion
Copying another GOs rotation with a configurable joint
Hi All,
I'm trying to drive a configurable joint to the same rotation as another game object. Basically I'm trying to get one marionette to shadow another.
Im using the following code:
public GameObject master;
public GameObject slave;
void Update (){
ConfigurableJoint cj = slave.transform.GetComponent(typeof(ConfigurableJoint)) as ConfigurableJoint;
cj.targetRotation = master.transform.rotation;
}
However, I don't get any rotation out of the slave. Can anyone explain what I should be doing?
Comment
Your answer
Follow this Question
Related Questions
using Contains(gameObject) to find and destroy a gameObject from a list 2 Answers
Temporarily disabling rigidbody & configurable joint 4 Answers
2D Platformer and Character Creation 0 Answers
How to keep a GameObject inside a collider? 3 Answers
How do I make Destroy(gameObject) work in my script? 1 Answer