![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Teorem |
Hello.
First of all I’m very novice, sorry if it’s a dumb question but I have read the doc and searched on google and I can’t understand the problem.
I’m trying to run a very simple script to launch my game scene from my main menu scene :
extends Control
func _on_launch_button_pressed():
get_tree().change_scene("res://Scenes/Game.tscn")
when I launch my main menu scene and click my launch button, the game closes and I have the following error : Invalid call. Nonexistent function ‘change_scene’ in base ‘SceneTree’.
Do I need to declare the function somewhere else? In an autoload or another script?