Skip to content

ModelLibrary

Extends EngineObject.

The models that entities draw (ModelRenderer.Model is an id from here; scripts see this as models). A model is loaded once per path whatever the number of entities that show it, and reloaded in place when its file changes, so entities keep their id. Ids are never reused.

Methods

load

function load(self, path: string): number

The id of the model at path, which is the same for every call with that path. path may also be the uid://… of a model, which is the file that has it. The file has to exist (or, in a game that shipped only its imported artifacts, be an imported one); whether it is a model shows when it is first drawn.