Something to do with a missing value I think but not sure

Godot Version

4.3-s

Question

Can someone check my script pls
func _unhandled_input(event: InputEvent) → void:
if event is InputEventMouseButton:
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
elif event.is_action_pressed(“ui_cancel”):
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
if Input.get_mouse_mode() = Input.MOUSE_MODE_CAPTURED:
if event is InputEventMouseMotion:
neck.rotate_y(-event.relative.x * 0.01)
camera.rotate_x(-event.y * 0.01)
camera.rotation.x = clamp(camera.rotation.x, deg_to_rad(-30), deg_to_rad(60))

Why event.y? Use relative of it.

I caught that so I changed it and I was missing an equal sign somewhere. thx for the help mate.

1 Like