- Home /
Multiple Touch Drag iOS
Hi all,
I was wondering if anyone can help.
I am trying to move two paddles for a pong style game on ios with the code below attached to each paddle with half the touch screen moving each paddle.
I cant seem to be able to move both paddles at the same time ,I think it the multi touch input being entered wrong . HELP!
function Update () {
if(Input.touchCount > 0 )
{ var touch = Input.touches[1]; if (touch.position.y > Screen.height/2) ////// (Each Paddle has a side of the screen) {
if (Input.touches[0].phase == TouchPhase.Moved)
{ var x = Input.touches[1].deltaPosition.x speed Time.deltaTime; var y = Input.touches[1].deltaPosition.y speed Time.deltaTime;
transform.Translate( new Vector3(x, 0 ) );
Many thanks in advance!
Your answer
Follow this Question
Related Questions
Unity2D iOS Dragable items by touch 0 Answers
EventSystem IDragHandler not working on iOS 1 Answer
Swipe Control Issue.. Need help 1 Answer
Tap to Move Drag to Look Null Reference 1 Answer
Simultaneous Touch Drag Controls 0 Answers