Avatarcomponent

AvatarComponent class

Avatar component, used to display VRM avatars in the game (for more info on VRM files, see VRM site (opens in a new tab))

See AvatarComponentData for the data schema used to create an audio component

Signature:

export declare class AvatarComponent extends Component3D<AvatarComponentData> 

Extends: Component3D<AvatarComponentData>

Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the AvatarComponent class.

Properties

Property

Modifiers

Type

Description

_plugins

any

_renderMode

any

activeAnimations

readonly

{}

animation

string

animation to play on the avatar by default when it loads.

avatarScale

number

get the scale of the avatar vrm

ignoreLOD

boolean

Do not use LOD optimization

opacity

number

Set the opacity of the avatar default is 1

picture

string

url of a picture to display on top the avatar.

renderMode

RenderMode

Model render mode. Defaults to "default"

text

string

text to display on top the avatar. Defaults to "".

url

string

url of the vrm file

useMixer

boolean

Use CPU Animation

visible

boolean

See Threejs doc (opens in a new tab)

vrmUrl

readonly

string

Methods

Method

Modifiers

Description

_getBBoxImp(target)

protected

_onCreateCollisionMesh()

protected

dispose()

protected

getDimensions()

getRawBBox(target)

getTransformData()

init()

protected

play(name, opts)

stop(name, opts)

updateAnimationMode(mode)

the render mode of the avatar component

updatePlugins(plugins)

the plugins of the avatar component

updateRenderMode(mode)

the render mode of the avatar component

updateVRM(url, data)

Updates the vrm displayed by the avatar component