Hi,
I am struggling to get this done, what i want to do is when a certain condition is met, I want to move the cube by a certain distance to the right and at the same the cube should align to the right.
How can this be done?
This is what i’ve got to so far. The cube is moving but it is turning the other side
void Update () {
GameObject cube = GameObject.Find("Cube");
cube.transform.Translate(Vector3.right *2* Time.deltaTime,cube.transform);
cube.transform.Rotate(2*Time.deltaTime, 0, 0);}
EDIT The rotation script is attached to child of cube…