Subscribe Only Working Once?

I am trying to run code whenever my timer succeeds.

It only works the first time.

I’m using the SuccessEvent.Subscribe()

I want it to work infinitely so that it stays subscribed, or runs the code every time, like I say it only works the first time.

Thanks for any help.

    StartLobbyTimer():void={
        Print("Starting Timer")
        timers_lobbby:=FindCreativeObjectsWithTag(timer{})
        for(Object : timers):
            if(Timer:=timer_device[Object]):
                Timer.SuccessEvent.Subscribe(TimerComplete)
    }

The TimerComplete Function only gets called once…

Hey astralpastral2,

Have you got your Timer Device set to restart on completion ?

Otherwise there is the Timed Objective Device

2 Likes

I find the timed objective device to be much more reliable, but it lacks ALOT of features the normal timer device has. I fear it could be deprecated in the future but im crossing my fingers it wont be as many of my core mechanics rely on it.

2 Likes

I think that device is much better for the coding method… I have since decided to just use devices and my problem was that the map was corrupted I think.

I made a new map and that problem went away.

1 Like