pandemonium_demo_projects/3d/ik/button_change_scene.gd

15 lines
310 B
GDScript3
Raw Normal View History

extends Button
export(String, FILE) var scene_to_change_to = null
func _ready():
# warning-ignore:return_value_discarded
connect("pressed", self, "change_scene")
func change_scene():
if scene_to_change_to != null:
# warning-ignore:return_value_discarded
get_tree().change_scene(scene_to_change_to)