Why clamp isn't working please help I'm a beginner

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

extends Spatial

var mouse_sens = 0.1
var camera_anglev=0
func _input(event):
if event is InputEventMouseMotion:
$Camera.rotate_y(deg2rad(-event.relative.xmouse_sens))
var changev=-event.relative.y
mouse_sens
if camera_anglev+changev>-50 and camera_anglev+changev<50:
camera_anglev+=changev

        rotation.y = clamp(rotation.y, deg2rad(-50.0), deg2rad(50.0))

What behavior are you experiencing?

timothybrentwood | 2021-05-12 21:30

the rotation never stops as much as i move the mouse as much the rotation is going i even tried other digits nothing worked

I_code_stuff | 2021-05-22 07:30