How to break a looping?

Hi, I’d like to know how not to have a loop. I explain it:
I’m playing a game where you have to squat down to not be seen for a while. But if I do not crouch down the problem, the police play an animation but in loop, and even if I leave the area completely.
So I’d like to break this loop so I don’t have this loop animation.

Thanks in advance :slight_smile:

Can you show us when the loop starts?

Voila :

I didn’t quite understand, if you don’t mind, could you take a capture of what it takes?
Thank you,

I use google translation

you just need to create a condition where the loop fails, for instance on end overlap begin a a different animation. in your case though it should actually be a loop it should just be stuck in the shooting animation until there is another overlap.

if you were using ai perception then it would be on see enemy begin shooting loop, then on lose sight of enemy go back to patrolling.

you need a condition that will change what the character is doing, so if the player is out of range (end overlap) then the character stops shooting. i recreated a bit of your script and added a little of my own. i dont have the same animations as you so just imagine they are the ones that you have. the basics here are when the character overlaps another character and that character is not crouched then the first animation will play, then theres a delay and the second animation plays, this second animation will keep playing until something tells it not to. in this case we use the on end overlap to break the loop and play a different animation (this could also just be some different behavior such as telling the character to go back to patrolling).

this is the basics of creating ai behavior, have the character do one thing and have conditions that change what it does.

1 Like

I thank you for taking the time to answer me, but it still doesn’t work, there’s always the loop:/
I’ll explain it a little better:
The person must crouch down to avoid being seen
If he doesn’t crouch down he’ll have to play the animation
Take the gun
And then he stays blocked on shoot, and a camera will approach and he will say “What are you doing here” And there he loses.
Problem is, the animation or he takes the gun repeats itself. I’ll try to make you a video and send you the link

Bandicam is not really ue4’s friend, sorry for the bugs.

Merci beaucoupppp :slight_smile:

seems like you just want the police guy to stop after the second animation, if thats the case then just uncheck looping on the animation node.

also your end overlap event is just repeating the same thing as your second animation so that wouldnt have accomplished anything.