Advertisement
Guest User

Untitled

a guest
Apr 17th, 2013
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void Update () {
  2.     //**********************************************************************************
  3.     //||||||||||||||||||||||||||||| MOVEMENT |||||||||||||||||||||||||||||||||||||||||||
  4.     //**********************************************************************************
  5.     if (Input.touchCount > 0) // TOUCHSCREEN CONTROLS
  6.     {
  7.         // Get movement of the finger since last frame             
  8.         touchDeltaPosition = Input.GetTouch(0).deltaPosition;          
  9.         touchDeltaPosition.x *= touchSpeed;
  10.         touchDeltaPosition.y *= touchSpeed;
  11.  
  12.         // Move object according to new positions
  13.         transform.Translate(touchDeltaPosition);
  14.         pos = transform.position;          
  15.         transform.position = pos;
  16.     }    
  17.     //**********************************************************************************
  18.     //||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  19.     //**********************************************************************************
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement