Client/scripts/ui/switch_to_scene.gd
Snoweuph 8b3f5e9ad1
All checks were successful
Quality Check / Linting (push) Successful in 6s
Quality Check / Linting (pull_request) Successful in 6s
TD-37: Fix Scene Switching Script
2025-02-12 13:50:15 +01:00

14 lines
304 B
GDScript

extends Button
@export var scene_name: String
func _ready() -> void:
connect("pressed", _on_Button_pressed)
func _on_Button_pressed() -> void:
if not scene_name:
push_error("Scene to switch to is not configured")
return
get_tree().change_scene_to_file("res://scenes/" + scene_name + ".tscn")