Hi, i’m want to build my game for android in doing so i want buttons in the game that move the character can be touch.
So i used TouchPhases in scripted that attached on button.
Here the code that i used:

But when i run it on my android device buttons not work properly and work like OnClick. i’m must touch them and release and again touch them, and most important than that is my animation for walking can’t be show. Because it run frame after frame.
So what is wrong?

You’re using TouchPhase.Began, which is only the case for 1 frame at the start of the touch. If you replace it with 2 other phases you should have movement as long as its pressed.

case TouchPhase.Moved:
case TouchPhase.Stationary:
//movement code

I don’t see any problem with the animations in the code.
That might be something in the Animator.