![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | pit |
am I missing something? the clamp section seems to be doing nothing
func _input(event):
if event is InputEventMouseMotion and GVC.menu_mode == false:
rotate_y(deg2rad(-1 * event.relative.x) * MOUSE_SENSITIVITY)
look_pivot.rotate_x(deg2rad(event.relative.y) * MOUSE_SENSITIVITY)
look_pivot.rotation.x = clamp(look_pivot.rotation.x, deg2rad(-90), deg2rad(90))
elif event is InputEventMouseMotion and GVC.menu_mode == true:
return
Log the values in the console then and see what the values are and how they are changing.
print(look_pivot.rotation.x, " ", clamp(look_pivot.rotation.x, deg2rad(-90), deg2rad(90)))
Juxxec | 2022-12-02 10:27
this is super weird. $LookPivot (is the node where I have my camera attached to) was rotated in the Y axis by 180°. for some reason, after setting it back to 0 and changing the inputs accordingly, the clamp section of the code started working again. Any ideas what the problem was?
pit | 2022-12-02 15:34