14 lines
334 B
GDScript
14 lines
334 B
GDScript
class_name RoomCamera extends Camera2D
|
|
|
|
|
|
var room: Room
|
|
|
|
|
|
func _ready() -> void:
|
|
await owner.ready
|
|
room = owner as Room
|
|
assert(room != null, "The RoomCamera type must be used only in the room scene. It needs the owner to be a Room node.")
|
|
|
|
|
|
func follow_player(_delta: float) -> void:
|
|
global_position = room.player.global_position
|