Skip to main content
added 28 characters in body
Source Link

I will change a scene on button click. But not change the main scene with button.

Node structure: main

  • scene (with childs)

  • button

    func pressed(): get_node("scene").change_scene("res://second_scene.tscn")

main
- scene (with childs)
- button

button.gd:

func pressed():
    get_node("scene").change_scene("res://second_scene.tscn")

It doesn't works.

I will change a scene on button click. But not change the main scene with button.

Node structure: main

  • scene (with childs)

  • button

    func pressed(): get_node("scene").change_scene("res://second_scene.tscn")

It doesn't works.

I will change a scene on button click. But not change the main scene with button.

Node structure:

main
- scene (with childs)
- button

button.gd:

func pressed():
    get_node("scene").change_scene("res://second_scene.tscn")

It doesn't works.

Source Link

GODOT Change scene in node

I will change a scene on button click. But not change the main scene with button.

Node structure: main

  • scene (with childs)

  • button

    func pressed(): get_node("scene").change_scene("res://second_scene.tscn")

It doesn't works.