Skip to content

Avatar(key) ⇒ THREE.Object3D ​

Uva supports full VR IK for VRM, Mixamo and most humanoid avatars. All of the combined avatars in the scene use one single draw call.

js
// Load using imported object name
const avatar = await Avatar("Rindo.vrm", (optional) stream : boolean);
// Load using an asset key
const avatar = await Avatar("a586e6....", (optional) stream : boolean);

stream ​

By default this is false. This makes avatars use geometry streaming, so avatars are dynamically loaded and unloaded based on their distance from the camera, and frustum/occlusion culling. If you have scenes with more then 30 avatars this is recommended.

js

world.add(avatar); // add avatar to the scene

// for WebXR this resets the avatar to standing, useful when switching between
// seated and standing playing environments
avatar.resetHeight();

// This makes the current player use the avatar
avatar.equip()

// This makes avatars have idle animations while stationary,
// and walk/run animations when moving
avatar.animate();
// Make an avatar walk/run to a new location
avatar.moveTo(destination : new THREE.Vector3(0, 0, 5), speed : 1 default);

Animations ​

You can load any mixamo animation, docs coming soon.

Default animations: ​

js
avatar.playAnimation("samba");

// You can replace 'samba' with any of:
hipHopDance;
jump1;
robotDance;
singing;
swimming;
floating;
flair;
situps;
catwalk;
ymca;
walking1;
idleThinking;
standingUp;
sitting1;
running;
sittingIdle;
layingShrug;
idle3;
layingIdle;
jumpingJacks;
jogging;
layingHandMove;
jump2;
idle2;
fastRun;
falling;
dancing;
burpee;
chickenDance;
idleYawn;
macarena;
idle1;
idleHappy;
idleTalking;
sittingTalking;
samba;
idleLookingAround;
hokeyPokey;

idleLookAtWatch,
climbWall,
catwalkNeutral,
laughing,
talking1,
talking2,
shy,
excited,
headNod,
headNod2,
idleUsingTablet,
idleLookDown,