Hay I am having a problem where after moving my mouse from when I was shooting it snaps back to where it was before shooting as when as it the recoil not applying when looking side to side if anyone needs more context let me know @ me (for an fps)
Player code
func _handle_mouse_movement(event: InputEventMouseMotion) -> void:
rotate_y(deg_to_rad(-event.relative.x * mouse_sensitivity))
pitch = clamp(pitch - event.relative.y * mouse_sensitivity, -90, 90)
camera.rotation_degrees.x = pitch
Gun code
func apply_recoil():
var tween = create_tween()
var recoil_amount = deg_to_rad(recoil_intensity)
tween.tween_property(camera, "rotation:x", camera.rotation.x + recoil_amount, 0.08).set_trans(Tween.TRANS_SINE).set_ease(Tween.EASE_OUT)
tween.tween_property(camera, "rotation:x", camera.rotation.x, 0.25).set_trans(Tween.TRANS_SINE).set_ease(Tween.EASE_IN)