- Home /
the "dancing robot" (animation problem)
I made a robot witch have 4 animations: walk, aim, put the gun away and an animation to make him look like he holds his gun and ready to shoot. the robot works like that: First he do the 4rd animation to get in position. Then, when I get close (100 meters) he aim on me (aim animation) and don't shoot. When I get closer (90 meters) he put away the gun, get closer to me (walk animation) untill there is 70 meters between us, then aim again and shoot on me a few bullets, stop (put away the gun animation) for 3 seconds to check if I still in that renge, else, he works accordingly to the range.
Now for my questions:
1: When he should aim on me he do the animation in loops and it look like "dancing robot". It don't need to do this, it even on "one time" when I checked it. When it needs to walk he just stop to "dance", don't do the "walk animation", and when he need to shoot he start to "dance" again with the same aiming animation (I didn't write the shooting code yet so he don't need to shoot). What I should do so he will stop "dancing" and work as he has to?
2: (BTW question). I want to make the robot like he patrolling around (make waypoint and no mather how much, one robot can have more waypoints then the other). After he attacked he should continue patrolling (more then 100 meters range). Can someone tell how to do that?
Sorry for poor english...
Your answer
![](https://koobas.hobune.stream/wayback/20220613132845im_/https://answers.unity.com/themes/thub/images/avi.jpg)