Quick answer: Unity CharacterController failing to step onto stairs at exactly half the step offset? Floating-point comparison treats half-height as on-or-off - bias the step offset slightly higher.
0.3m step height; controller step offset 0.3. Some steps succeed, others don't, depending on subpixel position.
Bias the offset
controller.stepOffset = stepHeight + 0.001f;Guarantees coverage of the boundary case.
Or quantize step heights
Author stairs at 0.25m, 0.3m, 0.4m (round numbers). Controller offset 0.31; covers all rounded values.
Debug with raycasts
Visualize the step-up sweep. Missing steps surface as failed sweeps; the boundary cases are visible.
“Floating point comparisons on physics thresholds are off-by-one bugs waiting to happen.”
Establish a 'add 1mm bias' rule for any threshold that determines pass/fail. The bias is below perception; the bug class disappears.