continued work on AI, still broken
This commit is contained in:
@@ -7,6 +7,9 @@ class_name EnemyReload
|
||||
|
||||
@onready var player = get_tree().current_scene.player
|
||||
|
||||
var move_target
|
||||
var look_target
|
||||
|
||||
var heartbeat : float = 3.0
|
||||
var remaining_bullets
|
||||
|
||||
@@ -35,7 +38,7 @@ func Update(delta):
|
||||
|
||||
|
||||
func Physics_Update(delta):
|
||||
enemy.turret_look_next.look_at(move_target())
|
||||
enemy.turret_look_next.look_at(look_target)
|
||||
enemy.turret_look.rotation = lerp(enemy.turret_look.rotation,Vector3(deg_to_rad(90),0,0),delta * enemy.turret_look_speed)
|
||||
|
||||
var destination = enemy.nav_agent.get_next_path_position()
|
||||
@@ -43,7 +46,7 @@ func Physics_Update(delta):
|
||||
var direction = local_destination.normalized()
|
||||
if enemy.global_position.distance_to(local_destination) > 1:
|
||||
enemy.velocity = direction * move_speed
|
||||
enemy.global_rotation.y = rotate_to_face2D(enemy,move_target(),delta,turret_speed)
|
||||
enemy.global_rotation.y = rotate_to_face2D(enemy,move_target,delta,turret_speed)
|
||||
|
||||
func finished_reload():
|
||||
if enemy.turret_look_next.is_colliding():
|
||||
|
||||
Reference in New Issue
Block a user