Skip to content

Commit 6a5155d

Browse files
Merge branch 'main' into addon
2 parents 7370da6 + 9dd735b commit 6a5155d

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

addons/character-controller/fps/bob/head_bob.gd

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func head_bob_process(horizontal_velocity:Vector3, input_axis:Vector2, is_sprint
9696
if is_sprint:
9797
input_axis *= 2
9898
if rotation_to_move:
99-
new_rotation += _head_bob_rotation(input_axis.y, input_axis.x, _delta)
99+
new_rotation = _head_bob_rotation(input_axis.y, input_axis.x, _delta)
100100

101101
head.position = new_position
102102
head.quaternion = new_rotation
@@ -115,9 +115,8 @@ func reset_cycles():
115115

116116

117117
func _head_bob_rotation(x, z, _delta) -> Quaternion:
118-
var target_rotation : Quaternion
119-
target_rotation.from_euler(Vector3(x * angle_limit_for_rotation, 0.0, -z * angle_limit_for_rotation))
120-
return lerp(head.quaternion, target_rotation, speed_rotation * _delta)
118+
var target_rotation := Quaternion.from_euler(Vector3(x * angle_limit_for_rotation, 0.0, -z * angle_limit_for_rotation))
119+
return head.quaternion.slerp(target_rotation, speed_rotation * _delta)
121120

122121

123122
func _do_head_bob(speed: float, delta: float) -> Vector3:

addons/character-controller/plugin.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ description="Modular Character Controller for Godot 4.
55
Includes FPS version with headbob and camera movement.
66
(Walk, Crouch, Sprint, Swim and Fly Mode)."
77
author="Expresso Bits and Whimfoome"
8-
version="2.1.7"
8+
version="2.1.8"
99
script="plugin.gd"

0 commit comments

Comments
 (0)