weapon recoil problem

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By xAkuma09

so i addet recoil but if i look a little bit up and shoot the recoil goes down instead of up

if fire:
	var side_recoil = rand_range(-5, 5)
	var recoil = rand_range(10, 35)
	up_recoil += recoil * delta
	head.rotation.x = lerp(head.rotation.x, deg2rad(head.rotation_degrees.y + up_recoil), delta)
	head.rotation.y = lerp(head.rotation.y, deg2rad(side_recoil), 3 * delta)
elif ads_fire:
	var side_recoil = rand_range(-3, 3)
	var recoil = rand_range(8, 20)
	up_recoil += recoil * delta
	head.rotation.x = lerp(head.rotation.x, deg2rad(head.rotation_degrees.y + up_recoil), delta)
	head.rotation.y = lerp(head.rotation.y, deg2rad(side_recoil), 2 * delta)
if !Input.is_action_pressed("fire") and can_fire:
	up_recoil = 0