pulled out target selection to its own node

This commit is contained in:
2024-04-01 17:08:47 +11:00
parent 05914a3c64
commit 16951a9beb
11 changed files with 117 additions and 112 deletions

View File

@@ -7,7 +7,7 @@ class_name ShapecastTower extends Tower
func _process(delta: float) -> void:
super._process(delta)
if targeted_enemy:
if target_finder.get_target():
particlesystem.emitting = true
else:
particlesystem.emitting = false
@@ -20,8 +20,8 @@ func shoot() -> void:
func aim() -> void:
yaw_model.look_at(targeted_enemy.global_position)
pitch_model.look_at(targeted_enemy.global_position)
yaw_model.look_at(target_finder.get_target().global_position)
pitch_model.look_at(target_finder.get_target().global_position)
pitch_model.rotation.x = 0.0