- Home /
Nav Mesh Velocity With Blend Tree (or simple state handling)
So I have a question involving nav mesh movement and animation.
Simply put, I'm working on a click-to-move action rpg, and when I click to start progressing towards my destination, I'd like a run animation to start playing. When they reach their destination, I'd like the animation to stop.
I can handle this two ways, simple static states or a 1D blend tree. I've tried both and had issues with both.
With simple static states, I'd simply flick a bool on or off when my movement velocity was 0 or not 0, the problem was that my velocity wouldn't become 0 right away, causing the animation to keep playing for a little after stopping. I played around with the values to no avail.
With blend trees, I'd like to handle this where 0 is idle, 1 is max running. However my velocity goes above that (to equal the speed of my nav mesh which is 4). I decided to try a workaround here by increasing the threshold to 4. This somewhat fixed the problem, but when I click in one direction, then I click behind my character as it's moving the velocity seems to reset to 0 and go back which causes a little animation glitch.
Overall:
When dealing with a click-to-move game, would you handle this with blend trees or static states, and if so how could I go about fixing my problem with that respective way?
How could I handle velocity better in general with nav meshes?
Thanks! Really sorry if this might have been posted before, but I couldn't find anything that exactly worked. Thank you!