I have a maze game. The player controls the x and z rotations of the board.
My code:
if(Input.GetKey("w")) {
transform.Rotate(Time.deltaTime*10, 0, 0);
}
if(Input.GetKey("a")) {
transform.Rotate(0, 0, Time.deltaTime*-10);
}
if(Input.GetKey("s")) {
transform.Rotate(Time.deltaTime*-10, 0, 0);
}
if(Input.GetKey("d")) {
transform.Rotate(0, 0, Time.deltaTime*10);
}
My problem is, when the board rotates, it rotates into the sphere, so the sphere doesn’t roll.
Yes the sphere is a rigidbody, and yes, all of the cubes that comprise the board have box colliders.
Help please?