Constantly Shooting Enemies

Before proceeding, please use the forum search feature at the top of the page to check if your question has already been answered.

How do I…

I want to make the enemy in my game shoot constantly every 3 to 6 seconds

What is the expected result

The enemy will constantly shoot fire every 3 to 6 seconds in a loop.

What is the actual result

It only happens once.

Related screenshots

Please look at the documentation for using trigger once. This means that it will only shoot once while true, and since there are no conditions, it is always true. Therefore it only shoots once. What you want to start a timer, and then generate a random number between 3 and 6. When this timer gets over that number, shoot, generate a new number, and restart the timer.

1 Like

Okay, thank you so much!

1 Like

Just a heads up about wait. Without a condition, the wait action will be processed on each frame. It will keep adding wait points to the list of waits. After 2 seconds the 1st wait will expire and it will process the delete fire objects. Since there aren’t any conditions, other waits will continue to be added and will expire, so on each frame it will delete any fire objects.