Recoil overcompensation fix
This commit is contained in:
parent
5a3fc03748
commit
1ccc833b1a
2 changed files with 5 additions and 3 deletions
|
|
@ -135,7 +135,7 @@ cull_mask = 1048573
|
||||||
fov = 90.0
|
fov = 90.0
|
||||||
script = ExtResource("3_qhqgy")
|
script = ExtResource("3_qhqgy")
|
||||||
compensation_time = 0.1
|
compensation_time = 0.1
|
||||||
compensation_delay = 0.1
|
compensation_delay = 0.2
|
||||||
|
|
||||||
[node name="molikman_hands" parent="Camera3D" instance=ExtResource("4_dqkch")]
|
[node name="molikman_hands" parent="Camera3D" instance=ExtResource("4_dqkch")]
|
||||||
transform = Transform3D(-1, 0, -8.742278e-08, 0, 1, 0, 8.742278e-08, 0, -1, 0, -1, 0)
|
transform = Transform3D(-1, 0, -8.742278e-08, 0, 1, 0, 8.742278e-08, 0, -1, 0, -1, 0)
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,9 @@ func rotate_camera(x,y) -> void:
|
||||||
rotation.x = clamp(rotation.x + y,-PI/2,PI/2)
|
rotation.x = clamp(rotation.x + y,-PI/2,PI/2)
|
||||||
orthonormalize()
|
orthonormalize()
|
||||||
if sign(vertical_compensation) == sign(y):
|
if sign(vertical_compensation) == sign(y):
|
||||||
|
if abs(vertical_compensation) - abs(y) < 0:
|
||||||
|
vertical_compensation = 0
|
||||||
|
else:
|
||||||
vertical_compensation -= y
|
vertical_compensation -= y
|
||||||
|
|
||||||
func recoil(x,y) -> void:
|
func recoil(x,y) -> void:
|
||||||
|
|
@ -55,5 +58,4 @@ func recoil(x,y) -> void:
|
||||||
|
|
||||||
func start_compensating() -> void:
|
func start_compensating() -> void:
|
||||||
compensate = true
|
compensate = true
|
||||||
print(vertical_compensation)
|
|
||||||
compensation_speed = vertical_compensation / compensation_time
|
compensation_speed = vertical_compensation / compensation_time
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue