Appearance
Kiln API / kiln/physics / Collider
Variable: Collider
ts
const Collider: Trait<{
shape: "box" | "ball" | "capsule" | "cylinder";
hx: number;
hy: number;
hz: number;
radius: number;
halfHeight: number;
friction: number;
restitution: number;
density: number;
sensor: boolean;
}>;A collider shape. On an entity with RigidBody it attaches to that body; on a child (ChildOf a body entity) it attaches with the child's Transform as the offset; alone it is static. 'box' uses hx/hy/hz half-extents, 'ball' radius, 'capsule' and 'cylinder' halfHeight + radius.