Files
Bullosseum/actors/player/player_follow_light.gd
siim 2fd41f4f69
CI / Decide whether to run (push) Has been cancelled
CI / Lint & headless tests (push) Has been cancelled
bull follow light
2026-09-08 19:15:14 +03:00

15 lines
418 B
GDScript

extends Node3D
var player: Node3D = null
func _process(delta: float) -> void:
# If we don't have the player yet, try to find them in the group
if not is_instance_valid(player):
var players = get_tree().get_nodes_in_group("player")
if players.size() > 0:
player = players[0] as Node3D
# If the player exists, follow their position
if is_instance_valid(player):
global_position = player.global_position