Guest User

Untitled

a guest
Feb 20th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. if(th.phase == TouchPhase.Began && (th.phase != TouchPhase.Moved))
  2. {
  3. StartTouchPos = th.position;
  4. }
  5. if (th.phase == TouchPhase.Moved)
  6. {
  7. currentpositiony = (((CurrentTouchPos.y - StartTouchPos.y) / Screen.height)) + savey;
  8. }
  9. if(th.phase == TouchPhase.Ended)
  10. {
  11. savey = currentpositiony;
  12. }
  13.  
  14. distance = th.deltaPosition.magnitude;
  15.  
  16. speed = distance / Time.deltaTime;
Add Comment
Please, Sign In to add comment