Can you explain in a simplified way the structure and operation of coroutines in godot

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Peppe

Hi everyone, could someone explain me in a simplified way the use of coroutines in godot? I’ve read the official documentation but not so much is understood. I would need them to perform this. I’m doing a test in 2D and I’m going to instantiate a missile at a time from a platform every time an object (a spaceship in my case) enters in the area defined by the platform, then if the ship goes out of the area the platform does not instantiate the missile and then the “process” ends there. So I need to know if I have to use the coroutines for this operation or something else.

:bust_in_silhouette: Reply From: klaas

Hi,
maybe this sheds some light on the topic …