Topic was automatically imported from the old Question2Answer platform.
Asked By
qtren
Suppose whenever I cast a skill, I create a one-shot timer with wait time 1 in script. Then it will stop after 1 second. But will it queue_free itself? I was reading the documentation and it doesn’t say anything about what happens to the timer after expiration so I assume it will just be stopped, and remain in my scene. But if that’s the case will there be a problem if I create too many timers? What is a good way to clean up all these expired one-shot timers? Thank you.
Once the queue_free() is executed the timer leaves the scene. You can see this by running your code and clicking on the Remote nodes to view the running nodes.
If you don’t free it up, it will hang around.
Yes, thanks for the info! I was thinking about this from a design perspective, and I realized I should really make my skill a scene, and once the timer expires, queue_free() the scene itself.