Files
godot-demo-projects/3d/ik/button_change_scene.gd
Christen Lofland 7e2a55aa07 3D Inverse Kinematics Godot 4 Conversion (Partial) (#1036)
* These changes allow the project to start and run in Godot 4.2

I hit some of the files with my formatter, if whitespace updates are not wanted I can remove those.
The project doesn't entirely work yet, but it runs. I am still working on making it work properly fully, but at least it starts now instead of crashing.

* Center text to match Godot 3 example better.
2024-08-27 05:13:54 -07:00

13 lines
220 B
GDScript

extends Button
@export_file var scene_to_change_to: String = ""
func _ready():
pressed.connect(change_scene)
func change_scene():
if scene_to_change_to != "":
get_tree().change_scene_to_file(scene_to_change_to)