Source Academy Modules
    Preparing search index...

    Function createCuboid

    • Creates a solid box in the scene - the general-purpose building block createFloor/createWall are thin presets of.

      Parameters

      • physics: unknown

        The physics world to add the box to.

      • position_x: number

        X position, in metres.

      • position_y: number

        Y (vertical) position, in metres.

      • position_z: number

        Z position, in metres.

      • width: number

        Box width, in metres.

      • length: number

        Box length, in metres.

      • height: number

        Box height, in metres.

      • mass: number

        Box mass, in kg (ignored for a "fixed" body).

      • color: string

        Any CSS color string.

      • bodyType: string

        "fixed" (immovable) or "dynamic" (affected by physics).

      Returns unknown