0
Q:

touch unity rotate on x axis

 #pragma strict    private var h : float;  private var v : float;  private var horozontalSpeed : float = 1.0;  private var verticalSpeed : float = 1.0;    function Update()  {      if (Input.touchCount == 1)      {          var touch : Touch = Input.GetTouch(0);                    if (touch.phase == TouchPhase.Moved)          {              var v : float = verticalSpeed * touch.deltaPosition.x ;          transform.Rotate ( h, 0, 0);                    var h : float = horozontalSpeed * touch.deltaPosition.y ;          transform.Rotate (0, -v, 0);          }     }       }
0

New to Communities?

Join the community