When reloading the same scene which is currently the current_scene, the script attached to the root node of the scene disappears. Every other script within the scene still appears. I tested this, by putting this:

func ready(): print("[DEBUG] I have a script!") into the script of the root node of the scene. Is this a known issue, or am I doing something wrong?

I’m reloading the scene with: @onready var startMenu:PackedScene = preload("res://ui/start_menu.tscn")

func _on_reload_pressed(): get_tree().change_scene_to_packed(startMenu)

Using the latest stable version

  • simple
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 year ago

    Seems like you might have an issue with how you set up the signals. So does _on_reload_pressed work before switching scenes, then stops working after switching? Are the signals connected to Control or StartMenu?

    Also if you send me the project I can take a quick look.