"Fire Projectile" - timer or loop?

Ask and answer questions about making games and related topics. Unrelated topics go in that other forum.

Moderators: marionline, SDHawk

Post Reply
Red Slime
Posts: 37
Joined: Fri Jan 13, 2023 1:13 am

"Fire Projectile" - timer or loop?

Post by Bluefeather42 »

I've been digging through the "Fire Projectile" example project. Is there any advantage to using the while loop instead of the timer or vice-versa?
User avatar
Bob the Hamster
Lord of the Slimes
Posts: 7653
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)

Re: "Fire Projectile" - timer or loop?

Post by Bob the Hamster »

The while loop will probably be slightly simpler

The timer avoids the problem that you can't have two scripts with wait commands running at the same time without the first one being paused by the second one.

If you are only doing the projectile script, and you know you won't have any other scripts running, use the while. Otherwise use the timer.
Post Reply