improvements to ai but still needs a lot of work

This commit is contained in:
derek
2025-04-28 16:32:34 -05:00
parent f0ec7bc953
commit 80cf7ec2c5
8 changed files with 83 additions and 34 deletions

View File

@@ -22,7 +22,7 @@ func Enter():
alarm_sound.play()
func update_waypoint():
enemy.nav_agent.set_target_position(enemy.character_follow.global_position)
enemy.nav_agent.set_target_position(move_target())
func current_target():
if enemy.is_player_visible():
@@ -65,7 +65,7 @@ func Update(delta):
Transitioned.emit(self,"reload")
func Physics_Update(delta):
enemy.turret_look_next.look_at(enemy.character_follow.global_position)
enemy.turret_look_next.look_at(move_target())
enemy.turret_look.rotation = lerp(enemy.turret_look.rotation,enemy.turret_look_next.rotation,delta * enemy.turret_look_speed)
var destination = enemy.nav_agent.get_next_path_position()