Hello everyone!
I have a globe that the user will rotate:
Here’s the code:
function Update () {
var horiz:float = Input.GetAxis("Horizontal");
var vert:float = Input.GetAxis("Vertical");
if(horiz > 0)
transform.Rotate(Vector3(0,1,0), Space.Self);
if(horiz < 0)
transform.Rotate(Vector3(0,-1,0), Space.Self);
if(vert > 0)
transform.Rotate(Vector3(0,0,1), Space.World);
if(vert < 0)
//print(transform.rotation.eulerAngles.z);
transform.Rotate(Vector3(0,0,-1), Space.World);
}
So for the vertical rotation, I will put a limit(ex: 10 degrees max) and
no limit (full rotation horizontally).
I have used the print to check/get the rotation, but instead it rotates the globe without
a keyboard input, as I run the game!
someone tell me why?