I have a top down survival game where enemies spawn every 3 seconds and i want that enemies that are outside the viewport are getting destroyed after an certain time so the layout isnt completly filled with them after like 3 minutes.
Like a timer that runs down when they go offscreen, but when they are on my screen again the timer stops and restarts when they are offscreen again.
Develop games in your browser. Powerful, performant & highly capable.
Add timer behaviour to the enemy then say :
enemy is on screen, start timer
enemy is not on screen (is on screen inverted), stop timer
enemy timer = time limit, enemy destroy
i made it exactly like that but it still wont work, is that right?
Ah sorry with a system trigger once attached so it starts the timer only once and not constantly. And with the timer counting down rather than up then the actions should be reversed so enemy not on screen start timer and enemy on screen stop timer.