hi all , please how i can limit the rotation on x and y … i,m still a biggener
this is my code :
var h : float;
var v : float;
var horozontalSpeed : float = 2.0;
var verticalSpeed : float = 2.0;
if (touch.phase == TouchPhase.Moved){
h = horozontalSpeed * touch.deltaPosition.x ;
transform.Rotate( 0, h, 0);
v = verticalSpeed * touch.deltaPosition.y ;
transform.Rotate( v, 0, 0);
}