s&box/field-guide
tag

#physics

21 items (1 guide · 20 fixes)

guides
fixes
26.07
"A frame-budget method for stylized s&box scenes"

Census tris × instances before decimating; prefer BoxCollider over ModelCollider for decorative props.

26.07
"Character facing derived from velocity flips 180 degrees on every pendulum reversal"

Deriving a visual's facing from horizontal velocity causes 180-degree snaps on any momentum reversal — lock facing to an attach-time azimuth for pendulums and oscillators.

26.07
"Collider choice that actually costs you"

BoxCollider is cheap and follows WorldScale; Capsule/ModelCollider don't scale with WorldScale and ModelCollider is costly on clutter.

26.07
"Double jump doesn't work with Jump() — set Velocity.z directly"

Jump() helpers clamp against rising velocity, eating the second impulse. Set Velocity.z directly for a reliable double jump.

26.07
"Editor play mode is hard-capped at 60 fps — cvars won't lift it"

Editor-embedded play mode pins at exactly 60 fps regardless of cvars. The cap is the compositor's vsync on the editor window, not the engine frame sync.

26.07
"GameObject.Destroy keeps rendering in edit mode — deferred queue not processed between regenerations"

A runtime-generated world root torn down with GameObject.Destroy() keeps rendering in edit mode because the deferred queue isn't flushed — use DestroyImmediate and sweep all matching roots.

26.07
"Ground snap pops on rolling slopes — rate-limit the downward snap"

An idempotent ground-snap jitters on curved terrain because the slope curves away within each step — ease the downward snap at a bounded glue rate.

26.07
"Kinematic movement that doesn't get stuck"

Always handle tr.StartedSolid — ignore that frame so an overlapped body can walk free; slide-trace the wish onto the hit plane.

26.07
"My model has no collision even though it loads fine"

RenderMeshFile alone compiles clean with zero physics — ModelCollider needs PhysicsMeshFile/PhysicsHullFile in the vmdl.

26.07
"My scaled-up tree's collider didn't scale"

CapsuleCollider and ModelCollider ignore WorldScale; BoxCollider follows it — bake scale into import_scale instead.

26.07
"Noclip in a trace-based kinematic controller is a state, not a collider toggle"

Disabling a collider does nothing for a hand-integrated kinematic controller — noclip must be a movement state that skips traces, gravity, and ground-snap entirely.

26.07
"Orient a flat decal box to the hit normal"

Rotation.FromYaw alone leaves a decal flat on the floor — build a rotation that aligns the thin axis to the surface normal, then offset along it.

26.07
"Ragdoll a scripted-rig NPC with pure engine physics"

PhysicsShapeList + PhysicsJointList in the vmdl + ModelPhysics toggle — no collapse clips, no SetBoneTransform.

26.07
"Rigidbody component API"

Rigidbody API verified across multiple projects — Gravity, MassOverride, Velocity, ApplyForce, and the recipe for a dynamic pushable prop.

26.07
"Rotation.FromYaw is counter-clockwise"

Rotation.FromYaw(+angle) is a LEFT (CCW) turn — get the sign right or steering, AI, and autopilot spiral the wrong way.

26.07
"Runtime world-building helpers"

FlatBox/Prop/Deco/Wire helpers plus Obstacle records as plain data beat physics queries for build validity.

26.07
"s&box units are inches"

1 m = 39.37 engine units — design in SI, convert once at the engine boundary, and audit every consumer.

26.07
"The bone-name `.` → `_` compiler trap"

Model compiler rewrites upper_arm.L → upper_arm_L; physics KV3 that still says .L makes limb bodies unknown while the torso works.

26.07
"Trace-based kinematic controllers don't fire triggers"

A hand-integrated trace mover has no collider component — ITriggerListener and OnTriggerEnter never fire. Use distance-polling instead.

26.07
"Vector3.Right is (0, -1, 0) — not +X"

Source engine convention: Forward = +X, Left = +Y, Right = -Y. Using Vector3.Right for '+X' silently slides geometry the wrong way.