Using animation code to simulate AI dodging a decent implementation or bad one?

So I’ve been thinking quite a lot recently about the best ways

to implement some basic AI dodging if for instance the enemy detects the player through line of sight code or of course if the player has their raycast over the enemy. Since we can pretty much keyframe anything I wondered why not simply just use animations to simulate dodging?

Would this be too expensive though? I can understand why using code would be better but it seems to me especially since I will be using imported character models I’ve animated myself that it might be a bit silly to do anything overly complicated with navmesh agents and so on for dodging unless I desperately wanted my enemies to use cover.

Now when I say dodging, remember Halo: Combat Evolved and when you fought the covenant? They would often do things like dive rolling and the elites in particular would bob and weave. I figured it might be worthwhile simply doing that and then if I want a more advanced cover system put that in place later. Except of course because I’d be using navmesh, the code can just take care of that sort of positioning and then with simpler animation code the animations can take care of the dodging.

You’ll note that even though the enemies here don’t actually take cover behind anything they play through animations and try to dodge if they detect the player is nearby or shooting at them.

I know this is an old thread but I’m going to bump this as I’m still looking for an answer or tutorial on the issue, I’d really like to implement it so I can get my AI acting a bit more intelligently.