Ok, I made an animated character in 3D studio max and exported it to unity. What I need is a script that makes the animation only play when the player is moving.
NOTE: My game is a 3D lineal plataform game, so I need a script that makes the player turn to Left or Right when press A or D (or respective arrows)
Is this too dificult? could anyone help me? Thanks.
while “walk” stands for whatever the desired animation is called.
The script should look like that :
if(Input.GetAxis(“Vertical”) > 0) {
transform.Rotate() rotate the character right
characterController.Move() move the character
animation.CrossFade() animate the movement
} else {
quite the same code but rotate the character left
}
You can do all that without the else part, but that should be easier to understand.
Good idea but i dont know anything about scripting so i dont know how to get the script working properly, but i will continue trying to do so. Anyway, it would be great if you make the script for me, if you have time, of course
Thanks for replying.
You’re going to need a LOT more than just that one script if you’re planning on completing your game. Best advice anyone can give you is - start learning to script.