loading.gd 453 B

12345678910111213
  1. # This acts as a staging scene shown until the main scene is fully loaded.
  2. extends Control
  3. func _ready():
  4. for i in 2:
  5. # Wait 2 frames before starting to change to the main scene,
  6. # so that the loading text can be shown instead of the splash screen.
  7. await get_tree().process_frame
  8. # Do not use `preload()` to avoid incurring the loading time before the
  9. # loading text can be shown.
  10. get_tree().change_scene_to_packed(load("res://test.tscn"))