Hi all,
I am trying to figure out how i can take an object and assign it individual rotation axis so it mimic’s the rotation of multiple other objects. So obj_0 should have rotation X follow obj_1 and rotation Y follow obj_2, etc.
I don’t understand why this wouldn’t work -
public GameObject cube;
public GameObject anothercube;
float x;
float z;
void update()
{
x = this.GetComponent().x;
z = anothercube.GetComponent().z;
cube.transform.rotation = new Quaternion(x, 0, z, 0);
}
// I understand you should be able to do this since this works - cube.transform.rotation = this.transform.rotation;
Any help is greatly appreciated.
Thanks.