s&box/field-guide
the symptom, in your words

"Rotation.FromYaw is counter-clockwise"

✓ verified on engine 26.07lane: Writing gameplayposted
▸ SYMPTOM
  • A vehicle consistently steers the opposite direction from input — keyboard left turns right, autopilot spirals into hazards.
  • AI pathfinding cross-product steering drives the agent away from the target instead of toward it.
  • The code looks correct — the sign bug is invisible in a static test, only obvious when something moves.
▸ CAUSE

Rotation.FromYaw(+angle) is a left (counter-clockwise) turn when viewed from above, following the Source engine's coordinate convention (+X forward, +Y left). If your steering math assumes positive = right turn (the common intuition from vehicle sims), every +steer input turns the wrong way.

This is especially insidious in autopilot / AI steering where a cross-product computes the turn direction — a sign swap silently inverts the entire navigation and the vehicle consistently drives into walls or off the map.

▸ FIX

Negate the yaw for right-positive steering:

snippet
// Right-positive steer input: negate for FromYaw
Rotation steerRot = WorldRotation * Rotation.FromYaw(-steer);

For AI cross-product steering, verify the sign once:

snippet
// Cross product gives turn direction
float cross = Vector3.Cross(forward, toTarget).z;
// cross > 0 means target is to the LEFT in Source convention
// FromYaw(+) turns LEFT, so:
float steer = cross * steerGain;
Rotation turn = Rotation.FromYaw(steer);
// This naturally turns toward the target

Diagnostic: If the vehicle or agent consistently heads the opposite way from where it's told, treat it as a FromYaw sign error first. One sign flip at the steering application point fixes it everywhere — don't chase the bug through the pathfinding logic.

▸ WHY IT WORKS

Source 2 / s&box uses a coordinate system where +X is forward and +Y is left. FromYaw(+angle) rotates from +X toward +Y — which is counter-clockwise (leftward) when viewed from above (+Z). This is mathematically consistent within the engine, but it catches anyone who assumes the more common "positive = clockwise / rightward" convention from vehicle sims or Unity.

Verified on engine 26.07 — seen in a real project.
s&box moves fast; an undated fix is a liability. Spot a stale detail?