I'm making good progress on a shooter I've been working on for the last few months, I've now moved onto the AI. Currently I perform a Raycast from my base Weapon class to check for impacts, and then invoke a function on the hit object after performing the necessary checks.
I've implemented an FSM pattern for my enemy AI and I'm having trouble coming up with an elegant solution to transition to a HurtState from another state to perform hurt animations and to momentarily stop the enemy's movement.
Since the states check their transition logic internally every frame it seems counter-intuitive to force a transition to the HurtState externally. What's the best way to achieve what I'm after without hacking something in or am I thinking too much into this?