How to detect when a scene has finished displaying.

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

This is probably a dumb question.

Is there a way to determine when a scene has finished displaying? I have some code that I do not want to run until the scene is completely displayed. I’ve tried wiring up handlers for various signals (ready, draw, focus_entered, etc) and they all seem to trigger before the scene has been displayed. Also tried call_deferred from the signal handler methods with no luck.

What am I missing?

:bust_in_silhouette: Reply From: Inces

scene root ready() function is called last, and everything should be visually displayed at this moment. Unless your graphics equipment is too slow. If this is so You may consider yielding/waiting for fixed amount of time after ready() before running this code piece.
You know, with yield(get_tree().create_timer(1.0),"timeout")
You can hide scene behind loading screen for that time