hey everyone
i have a very simple script, when the gui is touched, the camera rotates on the x axis.
this is the EXACT script that i have for the gui that rotates on the y axis, cept obviously edited to rotate on x instead
the problem is that it is not rotating exactly on the x axis, for some reason its rotating on the y and x axis, its very weird because even in the inspector it says its only rotating on the x, but it absolutely isnt
this is my script
var cam1 : Transform;
private var gui :GUITexture;
function Start(){
gui=GetComponent(GUITexture);
}
function Update(){
var count = Input.touchCount;
for (var i: int =0; i<count; i++){
var touch :Touch = Input.GetTouch(i);
if (gui.HitTest(touch.position))
{
//cam1.transform.Translate(-Time.deltaTime,0, 0);
cam1.transform.Rotate(-Time.deltaTime*40,0,0);
}
}
}
any ideas why this is happening?