diff options
| author | Jan Tuomi <jan@jantuomi.fi> | 2025-12-04 17:32:05 +0200 |
|---|---|---|
| committer | Jan Tuomi <jan@jantuomi.fi> | 2025-12-04 17:32:05 +0200 |
| commit | f97ee1d7c41e07296b6c31b9b85aa299805ba2f1 (patch) | |
| tree | b2276e82bb73544f6dd0d3853f81ed9a6fe6e80e /game_camera.gd | |
| parent | 6686bf1a7a6e81b30c8482cc1d2856f1401f4531 (diff) | |
Add test NPC
Diffstat (limited to 'game_camera.gd')
| -rw-r--r-- | game_camera.gd | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/game_camera.gd b/game_camera.gd index 4a9ac1d..b38d492 100644 --- a/game_camera.gd +++ b/game_camera.gd @@ -16,7 +16,10 @@ func _process(_delta: float) -> void: if targets.size() == 0: return for target in targets: - pos += target._camera_target() + if target.has_method("_camera_target"): + pos += target._camera_target() + else: + pos += target.global_position n += 1 global_position = pos / n |
