Welcome! Here you can paste sources and general debugging text, You can even set yourself a password if you want to keep it just for yourself.

Posted by tttt on May Sun 15th 6:24 PM - Never Expires
Download | New paste

  1. private float rotationRate = 3.0f;
  2.  
  3.     void Update () {
  4.         // get the user touch inpun
  5.         foreach (Touch touch in Input.touches) {
  6.             Debug.Log("Touching at: " + touch.position);
  7.    
  8.             if (touch.phase == TouchPhase.Began) {
  9.                 Debug.Log("Touch phase began at: " + touch.position);
  10.             } else if (touch.phase == TouchPhase.Moved) {
  11.                 Debug.Log("Touch phase Moved");
  12.                 transform.Rotate (touch.deltaPosition.y * rotationRate,
  13.                                  -touch.deltaPosition.x * rotationRate, 0, Space.World);
  14.             } else if (touch.phase == TouchPhase.Ended) {
  15.                 Debug.Log("Touch phase Ended");   
  16.             }
  17.         }
  18.     }
Language:
To highlight particular lines, prefix each line with @@





Hosted by KanGouLya for OpenTunisia
Donate for OpenTunisia Servers.
Powered by PHPaste 1.1