Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(th.phase == TouchPhase.Began && (th.phase != TouchPhase.Moved))
- {
- StartTouchPos = th.position;
- }
- if (th.phase == TouchPhase.Moved)
- {
- currentpositiony = (((CurrentTouchPos.y - StartTouchPos.y) / Screen.height)) + savey;
- }
- if(th.phase == TouchPhase.Ended)
- {
- savey = currentpositiony;
- }
- distance = th.deltaPosition.magnitude;
- speed = distance / Time.deltaTime;
Add Comment
Please, Sign In to add comment