i am using a touch joystick and i don’t know how to play my walking animation when i move my player with the joystick
In the animator window, create a bool called “isRunning” or something, you can call it whatever. Click on the transition arrow between the starting animation and the running animation, and at the bottom under parameters, add the “isRunning” bool to it. Next, go into the player script, and in your running function, create a bool called “playerHasHorizontalSpeed” (or something like that) and set it to this… bool playerHasHorizontalSpeed = Mathf.Abs(GetComponent<Rigidbody>().velocity.x) > Mathf.Epsilon;
Make sure to say “Rigidbody2D” if you’re doing a 2D game. This says that if the rigidbody’s speed is greater than Mathf.Espilon (basically 0), then you’re moving. Now, you can say GetComponent<Animator>().SetBool("isRunning", true)
which will start the running animation. Hope I explained this well! Also I just realized this is from 2 years ago…
Sorry if this doesn’t work…