Jul 3, 2024

Cacildes Adventure - Preview of Sewers in Cecily Town

 Working on new content for Cacildes Adventure!

I'm doing some improvements on AI and combat so that it will be more dynamic with enemies cutting distance to attack you!





The way the cutting distance works is we have two functions, MoveTowardsTarget and StopMoveTowardsTarget, where we define in the animation clip where we want the enemy to start moving towards us, and then we stop on a keyframe later. This allows for the animation to decide if the enemy should move closer.

This is all just a flag in code, that allows special behaviour to occur in the OnAnimatorMove() function of our AI character:


So if we are cutting distance, let's use the navmesh to do it. Otherwise, just sync the agent and character controller to the root motion of the animation playing (which is the default behaviour).


That's a nice way to handle this, and it makes combat a lot more fun!

Anwyay, expect more news soon :-) Stay tuned!