dacha
    Preparing search index...

    Class Collider

    Collider component for defining collision boundaries.

    Collider component defines the collision shape for an actor. It's used by the physics system to detect collisions between actors.

    // Create a box collider
    const boxCollider = new Collider({
    type: 'box',
    offset: { x: 0, y: 0 },
    size: { x: 64, y: 64 },
    layer: 'default',
    disabled: false,
    });

    // Create a circle collider
    const circleCollider = new Collider({
    type: 'circle',
    offset: { x: 0, y: 0 },
    radius: 32,
    layer: 'default',
    disabled: false,
    });

    // Add to actor
    actor.setComponent(boxCollider);

    Hierarchy (View Summary)

    Index
    actor?: Actor
    debugColor?: string
    disabled: boolean
    layer: string
    offset: Point
    componentName: string