Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

useModel

useModel(url, extendLoader?): LoadedModel

Loads a glTF or VRM file, suspending until it is ready, as drei’s useGLTF does but through three’s own loader, so a game ships one. Cached by URL, or by the whole list for an array: useModel.preload with the same argument warms the same entry.

Parameter Type
url string
extendLoader? ModelLoaderExtension

LoadedModel

useModel(urls, extendLoader?): LoadedModel[]

Loads a glTF or VRM file, suspending until it is ready, as drei’s useGLTF does but through three’s own loader, so a game ships one. Cached by URL, or by the whole list for an array: useModel.preload with the same argument warms the same entry.

Parameter Type
urls string[]
extendLoader? ModelLoaderExtension

LoadedModel[]