Skip to main content

findByName

Look up an entity by its human-readable name. Throws if no match is found.

Parameters

ParameterTypeDescription
namestringThe name of the entity to find
optionsFindOptions (optional)Search options (e.g., restrict to a subtree)

Returns

Promise<number>

Example

const vrmEntity = await entities.findByName("MyCharacter");

Pass a root option to search only within the children of a specific entity -- useful for finding bones inside a VRM hierarchy:

const headBone = await entities.findByName("head", {
root: vrmEntity,
});