CreateCapsule with Typescript Wrongly Requesting Initial Values

While developing a project with typescript I realize that the MeshBuilder.CreateCapsule throws error when not defining the initial value of the Capsule, not allowing me to use the default values of that mesh (at least annoying me with this error).

@babylonjs/core”: “^4.2.0”,

As a workaround you can not include the parameter and the default values will be used.

const player = MeshBuilder.CreateCapsule('player');
// same as passing options:
const options = {
        orientation: Vector3.Up(),
        subdivisions: 2,
        tessellation: 16,
        height: 1,
        radius: 0.25,
        capSubdivisions: 6,
        updatable: false,
    },

If you do supply an object then you need to supply the required parameters as indicated currently.

1 Like

I ll add this for the next release