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 do you loop an event?

Hi how do you loop an event to repeat once it finishes.

In the pic I want the bobble to loop, any ideas how to do this?

alt text

Product Version: UE 4.9
Tags:
more ▼

asked Mar 15 '16 at 05:12 PM in Blueprint Scripting

avatar image

MattStH
43 26 31 38

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

2 answers: sort voted first

How often are you wanting it to loop? Do you want it to cycle once completely and repeat? You could setup a gate to loop it and then a custom event to stop it if you needed to stop it. Like this: alt text

camerashakeloop.png (118.5 kB)
more ▼

answered Mar 15 '16 at 07:28 PM

avatar image

Black Phoenyx
4.2k 165 9 170

avatar image MattStH Mar 15 '16 at 07:53 PM

Hi there thanks for your reply, I would like it too loop and repeat indefinitely.

avatar image Black Phoenyx Mar 15 '16 at 08:03 PM

The setup I pasted will loop indefinitely and repeat at the interval set in the Length Float it will loop until the stop function is called. So if your entire shake happens over .5 seconds set it to .5 seconds if its a .2 second camera shake set it to .2 and so on that way it completes its cycle and starts over.

avatar image MattStH Mar 15 '16 at 10:16 PM

Hi that works pretty great. Unfortunately there is a little more to my blueprints, is there a way to switch the bobble, but also turning the retriggable delay off on the other bobble?

alt text

avatar image Black Phoenyx Mar 15 '16 at 10:21 PM

To stop one and switch you would call the custom stop function on whichever you want to stop, you could add a branch between the retriggerable delay and the gate and have the bool value set on switch so one would go true and the other would go false. The flip/flop is in place already the bool could be set to true or false there and then checked by a branch after the delay then when it fires false it stops the loop of the delay and gate.

avatar image Black Phoenyx Mar 15 '16 at 10:22 PM

Don't forget to mark this as resolved/answered.

avatar image MattStH Mar 15 '16 at 10:32 PM

I will mark as resolved/answer once I do it. But still having some difficulty, if you can show another pic of this I will mark as resolved.

avatar image Black Phoenyx Mar 15 '16 at 10:44 PM

Sorry, thought you had enough to run with it, here is a more detailed version screenshot. alt text

avatar image Black Phoenyx Mar 16 '16 at 12:45 AM

Did you get it working?

avatar image MattStH Mar 16 '16 at 12:51 AM

No I haven't yet, unreal crashed so getting round to it now.

avatar image Black Phoenyx Mar 16 '16 at 01:04 AM

Ouch! sorry to hear that.

avatar image MattStH Mar 16 '16 at 01:06 AM

Thanks for your patience, in the middle of making it the same as you have done. Ill get back asap! :)

avatar image MattStH Mar 16 '16 at 01:27 AM

Thanks that works perfectly!

avatar image Black Phoenyx Mar 16 '16 at 01:28 AM

Awesome! One less thing to worry about.

avatar image MattStH Mar 16 '16 at 01:37 AM

By any chance is there a way to create more than 1 begin play event? As when my game starts my character moves automatically, but I've to press M to start the shake atm.

avatar image Black Phoenyx Mar 16 '16 at 01:46 AM

No but you can create a custom event and have it fire on begin play

avatar image MattStH Mar 16 '16 at 02:08 AM

Oh ok sweet, I just noticed a sequence can work to fire multiple things off at once.

Is there a way to stop the head bobbling, completely by pressing a different button?

avatar image Black Phoenyx Mar 16 '16 at 02:10 AM

Yeah have that button fire the custom event to stop them both

avatar image MattStH Mar 16 '16 at 02:34 AM

Is there any particular way of doing this? I think I'm messing it up?

avatar image Black Phoenyx Mar 16 '16 at 02:39 AM

No particular way to do it just call the events the same as they are called during the switch only call them both to run them both:

alt text

avatar image MattStH Mar 16 '16 at 02:43 AM

Of course its so simple, thank you so much, I've learnt a lot from you!

avatar image MattStH Mar 17 '16 at 09:37 PM

By any chance is there a way to stop the head bobbing, but press the button again to resume with the current blueprint setup?

Also I have the button to stop the player movement to the same button, else where.

avatar image Black Phoenyx Mar 17 '16 at 09:45 PM

Why not something like this: alt text

avatar image MattStH Mar 17 '16 at 09:55 PM

I was close the custom event is what I was doing wrong. However there is a problem when I use this. The camera shake doesn't match the speed for the player you see when the button is used? (as there is 2 sprint and run). Can this be easily fixed? alt text

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

Wow it's like you guys built a wall so you could have a ladder go over it.

The best way to do this is to use the built in Timer. A timer fires a function or event every x seconds.

https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/UseTimers/Blueprints/index.html

more ▼

answered Mar 18 '16 at 03:09 AM

avatar image

Sentura
420 32 9 27

(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