9 lines
285 B
GDScript
9 lines
285 B
GDScript
extends Node
|
|
|
|
|
|
func goto_room(previous_room: Room, waypoint: Waypoint) -> void:
|
|
print("changing rooms")
|
|
await previous_room.tree_exited
|
|
var next_room: Room = waypoint.to_scene.instantiate()
|
|
next_room.initial_spawn = waypoint.spawn_coordinates
|
|
get_tree().root.add_child(next_room)
|