To cap off NPC movement (for now), I’ve implemented a system that allows me to animate the NPC’s rotation while it walks.
The system works something like this: We determine the desired direction of the current path segment, and then determine the rotation needed to point in that direction. While updating the animation, we determine if we need to rotate left or right, and we make sure that we don’t overshoot our target. Right now the rotation animation happens at a constant speed, but that’s something I might change in the future. Additionally, I’d like to play the model’s turning animation if the character needs to rotate but isn’t moving. For now this will do.
Not sure what I’ll tackle next. I need to identify the list of features I need to implement a small shootout in an arena. Until next time!