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))