#physics
21 items (1 guide · 20 fixes)
Census tris × instances before decimating; prefer BoxCollider over ModelCollider for decorative props.
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.
BoxCollider is cheap and follows WorldScale; Capsule/ModelCollider don't scale with WorldScale and ModelCollider is costly on clutter.
Jump() helpers clamp against rising velocity, eating the second impulse. Set Velocity.z directly for a reliable double jump.
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.
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.
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.
Always handle tr.StartedSolid — ignore that frame so an overlapped body can walk free; slide-trace the wish onto the hit plane.
RenderMeshFile alone compiles clean with zero physics — ModelCollider needs PhysicsMeshFile/PhysicsHullFile in the vmdl.
CapsuleCollider and ModelCollider ignore WorldScale; BoxCollider follows it — bake scale into import_scale instead.
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.
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.
PhysicsShapeList + PhysicsJointList in the vmdl + ModelPhysics toggle — no collapse clips, no SetBoneTransform.
Rigidbody API verified across multiple projects — Gravity, MassOverride, Velocity, ApplyForce, and the recipe for a dynamic pushable prop.
Rotation.FromYaw(+angle) is a LEFT (CCW) turn — get the sign right or steering, AI, and autopilot spiral the wrong way.
FlatBox/Prop/Deco/Wire helpers plus Obstacle records as plain data beat physics queries for build validity.
1 m = 39.37 engine units — design in SI, convert once at the engine boundary, and audit every consumer.
Model compiler rewrites upper_arm.L → upper_arm_L; physics KV3 that still says .L makes limb bodies unknown while the torso works.
A hand-integrated trace mover has no collider component — ITriggerListener and OnTriggerEnter never fire. Use distance-polling instead.
Source engine convention: Forward = +X, Left = +Y, Right = -Y. Using Vector3.Right for '+X' silently slides geometry the wrong way.