Unity Mobile Touch Control !

Hello guys!
So To day My Question is Unity Mobile Touch Control
I started a new Game
so This is Player (Ball) movement

I think this game play is a good practice Unity touch control on mobile
So How i implement this game play to code ?
and with this answer I Hope understand how touch control on mobile work

no answer come on guys ???

Hi ! ti implement this it’s realy simple :

go to my question :


you’ll find everything in that piece of code :

something called

Input.touches.Length == 1 >> means that the touch phase start

then something that normalise the swipe to get more simple coordonates

and then a t.phase == TouchPhase.Ended >> that means that you finish the swipe you can release the ball

so :

– detect the swipe

  • get the normalise coordonates
  • verify if the swipe is over then release the ball on the opposite coordonates.