- Home /
How to play character animation when using A* pathfinding
Hi I am trying to make racing game. In which I am using mecanim animation system to animate my character. Here are the conditions for the animation to play
Speed --> 1 Run
Speed --> 0-0.5 - walk
Speed --> <-0.10 -walk back
if I set the speed to 1, my character will run i.e
anim.setFloat("Speed",1);
will run my character.
As it is a racegame I need to move the other characters from source to destination. For which I am using A* Pathfinding project of arongberg. using the above algorithm I am getting the path and I am using simpleMove
of character control to move the character. Now the problems comes here
1.As the character needs to play run animation while moving, which is not happening, if I set
anim.setFloat("Speed",1); it is not moving in the direction of path instead it is moving on its own direction
I have tried to apply run animation directly instead of animation controller, but the same Happening.
if I remove all the animation character reaching to destination without any animation.
Here is the question where I have posted the code, I am asking the same question again but I was stuck with from past4 days.
http://answers.unity3d.com/questions/495397/how-to-make-my-character-move-in-the-direction-of.html
Your answer
![](https://koobas.hobune.stream/wayback/20220613110422im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Mecanim: change the animation even though it is not finish in playing 2 Answers
Mecanim & importing models with twist bones. 1 Answer
Humanoid animation issue 0 Answers
Animation works, pathfinding works, but they don't work together. 1 Answer
How can I make my animation to cover a particular distance? 0 Answers