Hi guys, I have a function that spawns obstacles at random points on my level and that function is being called by a Set Timer By Function Name node. I’ve been trying for some time to make the Set Timer node to call the function on varying time intervals, but i cant manage to make it work. I would like to call the function more frequently as time goes by (example: from start to 1 minute call the function every 3 seconds, from 1 minute to 2 minutes call the function every 1 second, and so on). I tried hooking up a timeline to the time slot but that didnt work. Can somebody help me solve this problem?
Thanks in advance
Did you tried to increase some “time” variable in any persistent class?
For example in game mode or player controller?
Just use some float variable, and start to increase it every tick by delta seconds when level started, and compare this value with something you need. Or better use some formula with depency on time.
One solution to this (although there are many other ways) is this:
Every time you set your timer use the function Get Game Time in Seconds, and then check the value of the game time. If this value is above 60, you can change the delay to 2, if above 120, change to 1. and so on. If you want a linear increase in the delay instead of just changing it once every minute, let me know and i’ll try write some code up for you