reloading works and returns to idle. still need to fix idle scanning
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user