ModelRoot

ModelRoot

The model root is created when your Worldcore session starts. It owns all actors and all model-side services.

Extends

Methods

# (static) modelServices() → {Array.<ModelService>}

Returns an array of model services that will be created when the session starts. You should overload this in your model root to instantiate only the services you need.

Note: Array entries can be either the name of a service, or an object containing the name of the service plus options to be passed to it when it's instantiated.

Returns:
Type
Array.<ModelService>
Example
static modelServices() {
        return [PlayerManager, {service: RapierPhysicsManager, options: {gravity: [0,-9.8, 0], timeStep: 15}}];
    }

# service(name) → {ModelService}

Returns a pointer to the named model service.

Parameters:
Name Type Description
name string

The public name of the model service.

Inherited From:
Returns:
Type
ModelService