TestGame/assets/objects/transition.gd
2024-12-29 03:07:59 +01:00

18 lines
408 B
GDScript

extends Node3D
@export var to_: Resource = null
func _ready() -> void:
pass
func _process(delta: float) -> void:
pass
func _on_area_3d_area_entered(area: Area3D) -> void:
if "Player" in area.get_groups():
print("Player stepped on transition to " + str(to_))
if not to_:
print_debug("No scene specified in transition" + str(self))
print(to_)
Messagebus.CHANGE_SCENE.emit(to_)