[SOLVED] Timers not working how their supposed to

Hello. I am making a fnaf fan game on gdevelop and making ai for bonnie, but the timers aren’t working. The code worked before but now it doesn’t. Here’s two images containing the code for bonnie:

please help me fix this.

Thank you.

What makes you say the timers aren’t working, or what specifically is going wrong?

the bonnie marker is supposed to move in to a random room using the BonnieAI variable, but the bonnie marker stops moving in number 1 or 2 in the BonnieAI var.

When BonnieAI is 1 though 5, it constantly restarts the timer so it never reaches 8 seconds. Try adding trigger once to all the events. That might cause a problem though if it picks the same number in a row.

Edit: It’s late. I’m tired. The events are chaotic to me. I would slim it down to 1 timer. It might be easier to put a hidden object in each location instead of fixed numbers and then use the pick a random object If you want it to slowly move closer or whatever the various numbers represent then you could add variables to tweak it. I just think it needs 1 mechanism not 5.

This moves newsprite2 to a random newsprite every 2 seconds. I used 2 just for demonstration and left the sprite visible.

try me. There are on interactions.

This can be modified to include extra logic or strategy,


Something like this would gradually move the BonnieMarker toward the last room. All of the NewSprite objects have an ID variable. As the room variable increases, it picks a different group. ID 0 is on top and ID 6 is on the bottom. This is one way. I’m not saying it’s the best. Just one way.


Edit: I modified it bc it wouldn’t hit the last point. It might not be perfect but the concept is solid.

1 Like

I got it working using only one timer. Thanks

1 Like