Repeated function with an interval (SOLVED)

Hi, i’m trying to make a game in wich i need a function to be repeted periodically and i have tried to do it with go.animate but it doesn’t work. I give you a screenshot of my code and error message :

I’m sorry if i have done some English’s mistake

Try this - https://github.com/britzl/defold-timer :slight_smile:

I tried to do it with this but it doesn’t work, i don’t understand how i have to do with this ?


it still spawn all my game object without any timer …

Try to place your code at function init.

1 Like

Thank you for your help! It’s working now and I’ve been trying to do it since a while :smiley:

1 Like

What you did in your screenshot was to create a new repeating timer every frame (I’m surprised nothing crashed!). You should do it in init() to create a single repeating timer.

1 Like