x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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 :)

Product Version: UE 4.19
Tags:
more ▼

asked May 10 '18 at 12:16 PM in Blueprint Scripting

avatar image

Tec_Zone
6 1 2 7

avatar image goncasmage May 10 '18 at 01:31 PM

Can you show us when the loop starts?

avatar image Tec_Zone May 10 '18 at 02:48 PM

Voila : alt text

capture.png (412.8 kB)
avatar image ThompsonN13 May 10 '18 at 03:24 PM

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.

avatar image Tec_Zone May 10 '18 at 03:32 PM

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

avatar image Tec_Zone May 10 '18 at 03:33 PM

I use google translation

avatar image ThompsonN13 May 10 '18 at 04:38 PM

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.

alt text

capture.png (270.3 kB)
avatar image Tec_Zone May 10 '18 at 07:07 PM

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 Shooting 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

avatar image Tec_Zone May 10 '18 at 07:15 PM

Bandicam is not really ue4's friend, sorry for the bugs. https://youtu.be/Qj8uNf2gbyo

avatar image Tec_Zone May 11 '18 at 01:48 PM

Merci beaucoupppp :)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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.

more ▼

answered May 10 '18 at 09:38 PM

avatar image

ThompsonN13
10.1k 33 10 25

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question