bugged-racing/scenes/test_level.gd

19 lines
506 B
GDScript
Raw Normal View History

2021-11-12 23:03:35 +00:00
extends Spatial
const camera = preload("res://player/camera.tscn")
onready var spawn_point = $PlayerSpawnLocation
var player_node: Node
2021-11-13 22:55:18 +00:00
var gui: Node
2021-11-12 23:03:35 +00:00
func _ready() -> void:
player_node.global_transform = spawn_point.global_transform
add_child(player_node)
2021-11-13 22:55:18 +00:00
add_child(gui)
2021-11-12 23:03:35 +00:00
var player_camera = camera.instance()
player_camera.follow_target_path = player_node.get_path()
add_child(player_camera)
2021-11-13 22:55:18 +00:00
func spawn_player(player_node: Node, gui: Node) -> void:
2021-11-12 23:03:35 +00:00
self.player_node = player_node
2021-11-13 22:55:18 +00:00
self.gui = gui