tweaks to enemy idle, still getting the turret looking dialed in
This commit is contained in:
@@ -372,7 +372,6 @@ transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0,
|
||||
collision_layer = 32
|
||||
collision_mask = 109
|
||||
mass = 45.0
|
||||
center_of_mass_mode = 1
|
||||
continuous_cd = true
|
||||
script = ExtResource("1_0qjnf")
|
||||
weapon_drops = Array[Resource]([ExtResource("2_fw6eu"), ExtResource("3_vrqjr"), ExtResource("4_45tks"), ExtResource("5_koj0g"), ExtResource("6_plk4s"), ExtResource("7_t1qyn")])
|
||||
|
||||
@@ -12,7 +12,7 @@ config_version=5
|
||||
|
||||
config/name="First Person Test"
|
||||
config/tags=PackedStringArray("fps")
|
||||
run/main_scene="uid://f7e0v1r6ra6c"
|
||||
run/main_scene="uid://bk4pn4k7n51ux"
|
||||
config/features=PackedStringArray("4.4", "Forward Plus")
|
||||
config/icon="uid://6svuq1l83al5"
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -89,10 +89,6 @@ func _ready():
|
||||
|
||||
func _process(delta):
|
||||
move_and_slide()
|
||||
turret_current_moving_speed = (turret_look_next.rotation - turret_look.rotation).length()
|
||||
#if turret_current_moving_speed > 1:
|
||||
#servo_single.play()
|
||||
|
||||
|
||||
func stun():
|
||||
state_machine.on_child_transition(state_machine.current_state,"stunned")
|
||||
|
||||
Reference in New Issue
Block a user