I'm thinking about rewriting the character controller in my game project and wondering what's the best way to handle a complex character controller which relies on states for it's logic. Currently I'm using unity's animation state machine since the states for the controller are heavily coupled with the animations (i.e. only specific actions can be done when certain animations are playing) but recently as the states become more complex, the limitations of the animation state machine are becoming apparent.
What's the best way to handle this sort of thing?