Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Update () {
- //**********************************************************************************
- //||||||||||||||||||||||||||||| MOVEMENT |||||||||||||||||||||||||||||||||||||||||||
- //**********************************************************************************
- if (Input.touchCount > 0) // TOUCHSCREEN CONTROLS
- {
- // Get movement of the finger since last frame
- touchDeltaPosition = Input.GetTouch(0).deltaPosition;
- touchDeltaPosition.x *= touchSpeed;
- touchDeltaPosition.y *= touchSpeed;
- // Move object according to new positions
- transform.Translate(touchDeltaPosition);
- pos = transform.position;
- transform.position = pos;
- }
- //**********************************************************************************
- //||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- //**********************************************************************************
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement