Advertisement
Guest User

Untitled

a guest
Dec 19th, 2014
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     var strzalka : Rigidbody2D;
  2.         function Update () {
  3.         for (var i = 0; i < Input.touchCount; ++i) {
  4.             if (Input.GetTouch(i).phase == TouchPhase.Began) {
  5.                 // Construct a ray from the current touch coordinates
  6.                 var ray = Camera.main.ScreenPointToRay (Input.GetTouch(i).position);
  7.                 if (Physics.Raycast (ray)) {
  8.                     // Create a particle if hit
  9.                     if(strzalka.transform.position.x > -11)
  10.             strzalka.transform.Translate(-PlayerPrefs.GetInt("kursor")*Time.deltaTime, 0, 0);
  11.                 }
  12.             }
  13.         }
  14.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement