How to set 3 function in specific order and for specific time of interval ?

Hi, i m new in unreal engine, and i m kind a stuck in my game development.

**So my question is **
Suppose i created three function and i want to call function in order of 1-2-3-2-1… Like i can call function 1 but for 120 seconds only and when time is finish, time reset to 0 and i can call function 2 for 120 seconds and so on…
How can i do that ?

Hello,

you can use delay node.

If you want to go further you can try timeline node.

Hi thank for quick reply
But as u can see it is kind of loop and if i put delay before evry function than my fist function will be called after 120 sec and i want to call this functions from beginning of the game till character dies or player left the game
I mean if u know how than can u share blueprint picture

Sorry for late reply but site doesn’t worked for me.

Coppy this to your project content directory

https://drive.google.com/open?id=1-tsBdkCn3JuvrY1faDqbI_HtXbFGLDsF

Wow i have never seen this quick replys on any site.

I don’t even understand this blue print but i know this is exactly what i want , i ll try to figure it out my self , if i can’t than ask u
Thank you very much

Edit
Even if i don’t understand it yet, will it work exactly same as i asked if i copy it and change it to 120 seconds?

Like this:

The Time is set to 2s here. You can also make the Time into a variable and use an extra Select node to fire each function for X seconds rather than a fixed 120.

Currently it fires f1 (2s) - f2 (2s) - f3 (2s) - f2 (2s) - f1 (2s); and restart from the beginning of Select node.


Timer will fire the Increase Index event every 2s, add 1 to the current value, wrap it around 5 using modulo (so the whole thing will eventually restart) and Set the final Next Function Index value. This value is then used on the Select node to step through the required index order (which you can change as your heart desires :slight_smile:

Event tick is firing through the Switch based on the value at the Next Function Index in the Select node.

Seems to be working as you described but I might have missed something.

Let me know and good luck!

I’ll just add that his could probably be done with a single Timeline node with a vector track instead. But the time will be fixed since you cannot dynamically adjust tracks run-time (unless you load an external curve, not sure whether this can be done in BP)

@Przemek2222 looks like your suggestion could/should work, it does look a bit crazy and unsustainable, though. Also, that delay node during Timeline’s tick is not really a good coding practice (even though it should work)

Don’t be sorry for reply man becoz i have never seen this fast reply anywhere else hahaha

Thanx for reply tho i ll give it try as soon as i sit in front of pc

Maybe but in my opinion, yours is too bit advanced as for who said that’s new to unreal.