"Vector3.Right is (0, -1, 0) — not +X"
Geometry or movement that should go along +X instead travels along -Y. Doors slide along their face normal instead of sideways, wall grids tile across the wrong axis, or a directional offset points 90 degrees off from where a comment says it should.
s&box inherits the Source engine's left-hand coordinate convention:
| Named vector | Value |
|---|---|
Vector3.Forward | (+1, 0, 0) — world +X |
Vector3.Left | (0, +1, 0) — world +Y |
Vector3.Right | (0, -1, 0) — world -Y |
Vector3.Up | (0, 0, +1) — world +Z |
Vector3.Right is not +X. If you write Vector3.Right intending "the positive X direction," every calculation using it silently operates on -Y instead.
Use literal axis vectors for anything directional where you mean a specific world axis:
// DON'T — Vector3.Right is (0, -1, 0)
var slideDir = Vector3.Right;
// DO — be explicit about the axis you want
var slideDir = new Vector3( 1, 0, 0 ); // world +XFor rotated-frame directions, derive from the object's own Rotation:
var localRight = Transform.Rotation * new Vector3( 0, -1, 0 );
var localForward = Transform.Rotation.Forward; // +X in local frameCatching it early
A build-time audit that checks spawned transforms against their expected plane catches axis swaps before they ship. For a grid of objects that should lie in a plane, assert that the max off-plane distance is near zero:
float maxOff = spawned.Max( t => MathF.Abs( Vector3.Dot( t.Position - origin, planeNormal ) ) );
if ( maxOff > tolerance )
Log.Warning( $"Grid off-plane by {maxOff:F1}u — suspect axis swap" );This is a silent wrong-value bug — the code compiles, runs, and looks almost plausible. You only notice when a door slides the wrong way or a grid is rotated 90 degrees. The Source convention is consistent (Forward = +X everywhere), but naming Right as -Y catches anyone coming from Unity or Unreal conventions.