tweaks to enemy idle, still getting the turret looking dialed in
This commit is contained in:
@@ -10,7 +10,8 @@ var wander_time : float
|
||||
var scan_time : float
|
||||
|
||||
const WANDER_AMT = 50
|
||||
const TURRET_TURN_AMT : float = 180.0
|
||||
const TURRET_TURN_AMT : float = 90.0
|
||||
const TURRET_SCAN_SPEED : float = .5
|
||||
|
||||
func randomize_wander():
|
||||
var x = randf_range(-WANDER_AMT,WANDER_AMT)
|
||||
@@ -21,11 +22,13 @@ func randomize_wander():
|
||||
|
||||
func randomize_turret_scan():
|
||||
scan_direction = -scan_direction
|
||||
enemy.turret_look_next.rotation = Vector3(0,scan_direction,0)
|
||||
scan_time = randf_range(5,10)
|
||||
|
||||
func Enter():
|
||||
super()
|
||||
randomize_wander()
|
||||
scan_direction = TURRET_TURN_AMT
|
||||
scan_direction = deg_to_rad(TURRET_TURN_AMT)
|
||||
|
||||
func Update(delta: float):
|
||||
if wander_time > 0:
|
||||
@@ -41,8 +44,7 @@ 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)
|
||||
enemy.turret_look.rotation = lerp(enemy.turret_look.rotation,enemy.turret_look_next.rotation,delta * TURRET_SCAN_SPEED)
|
||||
|
||||
var destination = enemy.nav_agent.get_next_path_position()
|
||||
var local_destination = destination - enemy.global_position
|
||||
|
||||
Reference in New Issue
Block a user