reloading works and returns to idle. still need to fix idle scanning

This commit is contained in:
derek
2025-04-22 15:50:59 -05:00
parent e7fd5bd4b3
commit 6217725c19
10 changed files with 73 additions and 23 deletions

View File

@@ -40,6 +40,10 @@ func Update(delta: float):
func Physics_Update(delta : float):
if enemy:
#turret transform
enemy.turret_look_next.rotation = Vector3(0,scan_direction,0)
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()
var local_destination = destination - enemy.global_position
var direction = local_destination.normalized()
@@ -49,7 +53,6 @@ func Physics_Update(delta : float):
var look_target = enemy.spider_look_next.global_rotation.y
enemy.global_rotation.y = lerp(enemy.global_rotation.y,look_target,delta * 3)
enemy.turret_look.rotation.y = lerp(enemy.turret_look.rotation.y,enemy.spider_look_next.rotation.y + deg_to_rad(scan_direction),delta * enemy.turret_look_speed)
if enemy.turret_look.is_colliding() and enemy.turret_look.get_collider() is Player:
Transitioned.emit(self,"attack")