"Mouse-look camera reads zero from Input.AnalogLook unless cursor is locked"
▸ SYMPTOM
A mouse-look camera reads Input.AnalogLook and gets Pitch = 0, Yaw = 0 every frame -- the camera never turns. Hold-right-click-to-look, freecam, FPS camera -- all read zero.
▸ CAUSE
Input.AnalogLook only accumulates a mouse delta while the cursor is captured (locked to the game window). A free/interactive cursor yields zero -- the delta is consumed by the OS cursor movement instead.
The trap is Mouse.Visible = false (the deprecated API). It resolves to MouseVisibility.Auto with Mouse.Active = true -- the cursor is still interactive, not locked. So setting Mouse.Visible = false does nothing for AnalogLook.
Only Mouse.Visibility = MouseVisibility.Hidden gives Mouse.Active = false -- the "locked to the game" state that AnalogLook needs.
▸ FIX
Drive the cursor with Mouse.Visibility, never the deprecated Mouse.Visible:
// While looking (FPS mode, hold-RMB, etc.)
Mouse.Visibility = MouseVisibility.Hidden; // locks cursor, AnalogLook works
// While in UI / menu / cursor mode
Mouse.Visibility = MouseVisibility.Visible; // or AutoFor a hold-to-look pattern:
protected override void OnUpdate()
{
Mouse.Visibility = Input.Down("attack2")
? MouseVisibility.Hidden
: MouseVisibility.Visible;
if (Mouse.Visibility == MouseVisibility.Hidden)
{
var look = Input.AnalogLook;
Angles += new Angles(-look.pitch, look.yaw, 0);
}
}Diagnostic recipe: log Mouse.Visibility and Mouse.Active after setting the cursor state. If Active is true, the cursor is not locked and AnalogLook will be zero.
▸ WHY IT WORKS
The engine's MouseVisibility.Hidden mode captures the OS cursor and routes raw mouse deltas into Input.AnalogLook. The other modes (Visible, Auto) leave the cursor free for UI interaction, and the mouse delta goes to the OS cursor position instead of the input accumulator. The deprecated Mouse.Visible bool maps to Auto/Visible but never to Hidden, which is why it cannot enable mouse-look.