Skip to main content

resolve_gdscript_coroutine

Function resolve_gdscript_coroutine 

Source
pub async fn resolve_gdscript_coroutine(variant: Variant) -> Variant
Expand description

If the object is a GDScriptFunctionState, await it. If not, return it unmodified. Note that, unlike GDScript, this function does NOT attempt to detect and await signals. Only actual GDScriptFunctionState objects will be awaited.

This is the function used under-the-hood by the godot_await! macro, but it can also be used independently, for instance, if you need to store the future (as a Future) and not evaluate it yet.