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"

Switch on Int in sequence using a timer

I have a random music system running on a two second timer (the custom event) - so every two seconds one of these notes will play. I want to be able to structure it slightly though - so if it starts on 0 then it will run a sequence though 0-1-2-3, and if it starts on 4 it will run the sequence 4-5-6-7 and so on. Is this possible? I want to be able to randomly run sequences but I have to have it running on a two second timer - meaning it's going to fire every two seconds. If I use a sequence and delays it will fire again and another sequence will start playing while the previous one is playing.

To get started, how might I ensure the Switch on Int will run in sequence from 0 to 3, and then back to the start, in this example?

alt text

Product Version: UE 4.18
sequence.png (136.0 kB)
more ▼

asked Nov 18 '17 at 05:22 PM in Blueprint Scripting

avatar image

51 7 14 22

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

This will fire a number of pins in a sequence with 2s intervals, terminate and wait for retrigger:

alt text

capture.png (287.2 kB)
more ▼

answered Nov 18 '17 at 09:37 PM

avatar image

13.6k 74 25 57

avatar image Donalf Nov 18 '17 at 11:28 PM

Thanks Everynone - if I just wanted the Switch on Int to cycle through from beginning to end with 2 second pauses between ints and then keep repeating without having to retrigger, how would I go about that?

avatar image Everynone Nov 19 '17 at 12:01 AM

Instead of clearing the timer, set the index to the starting value. You will need to introduce an extra variable that stores that value.

avatar image Donalf Nov 19 '17 at 12:27 AM

Thanks! I got it using this, which is similar to what you're suggesting, I think alt text

got-it.png (136.3 kB)
(comments are locked)
10|2000 characters needed characters left
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