gun movement and swing tweaks
This commit is contained in:
@@ -40,6 +40,7 @@ dead_player = ExtResource("2_4hoys")
|
|||||||
SENSITIVITY = 0.008
|
SENSITIVITY = 0.008
|
||||||
BOB_AMP = 0.085
|
BOB_AMP = 0.085
|
||||||
weapon_holder = NodePath("Head/Camera3D/WeaponHolder")
|
weapon_holder = NodePath("Head/Camera3D/WeaponHolder")
|
||||||
|
weapon_sway_amount = 0.5
|
||||||
|
|
||||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
||||||
visible = false
|
visible = false
|
||||||
|
|||||||
@@ -303,12 +303,12 @@ func _on_pick_up_magnet_body_entered(body):
|
|||||||
|
|
||||||
func weapon_tilt(input_x, delta):
|
func weapon_tilt(input_x, delta):
|
||||||
if weapon_holder:
|
if weapon_holder:
|
||||||
weapon_holder.rotation.z = lerp(weapon_holder.rotation.z, -input_x * weapon_rotation_amount * 10, 10 * delta)
|
weapon_holder.rotation.z = lerp(weapon_holder.rotation.z, -input_x * weapon_rotation_amount * 10, 4 * delta)
|
||||||
|
|
||||||
func weapon_sway(delta):
|
func weapon_sway(delta):
|
||||||
mouse_input = lerp(mouse_input, Vector2.ZERO, 10 * delta)
|
mouse_input = lerp(mouse_input, Vector2.ZERO, 10 * delta)
|
||||||
weapon_holder.rotation.x = lerp(weapon_holder.rotation.x, mouse_input.y * weapon_rotation_amount, 5 * delta)
|
weapon_holder.rotation.x = lerp(weapon_holder.rotation.x, mouse_input.y * weapon_sway_amount, 10 * delta)
|
||||||
weapon_holder.rotation.y = lerp(weapon_holder.rotation.y, mouse_input.x * weapon_rotation_amount, 5 * delta)
|
weapon_holder.rotation.y = lerp(weapon_holder.rotation.y, mouse_input.x * weapon_sway_amount, 10 * delta)
|
||||||
|
|
||||||
func weapon_bob(vel : float, delta):
|
func weapon_bob(vel : float, delta):
|
||||||
if weapon_holder:
|
if weapon_holder:
|
||||||
|
|||||||
Reference in New Issue
Block a user