Hello everyone,
I have trying for the past few days battle with creating an AI for a game I am working on.
The idea is that I have an enemy that doesn't moved and fixed to the ground (as if it is a turret), now what I want to do is what when the player is near the enemy it would taunt the player and keep looping the taunt. Once, the player gets closer, it starts attacking. If the player backs up and in enters the taunting distance the enemy goes into taunting loop again. If he exits, the enemy disappears.
What I have done so far is that I created 2 box triggers one inside the other (the first is large, the second is small) and then I created the FSM and actions to play the roar animations and such and it works perfectly fine (even with the exit animation).
The problem comes when the player enters the second trigger, in that case, it plays the animation for attacking (on the second trigger) and the roar/taunt animation (on the first trigger). I tried everything with "Stop Animation" action but it never worked.
I tried another thing, keeping all actions in one trigger instead of dividing things over two triggers and making the second trigger (smaller one) to just send an action to the larger trigger's FSM to play attack animation (instead of the first setup where each trigger handled his own animations separate from the other). Unfortunately when I did that, the attack animation never plays and it is the main loop with roar/taunt with no other changes.
Any ideas how I go about tackling this one?
Thank you very much.