Custom Models and Animations
Using Custom Character Models
By default, the SimpleCharacter component uses a built-in robot avatar. You can easily replace this with your own 3D model by providing a URL to the model file in any of the following formats:
- VRM - The standardized VRM format for avatars requires no additional configuration
- GLTF - (or also glb) Standard 3D Model format - make sure to use the standard vrm bone names as shown below or provide a
boneMap.
VRM 1.0 humanoid bone names (click to expand)
The following are the standard VRM 1.0 humanoid bone names your GLTF rig should use (aligned with the VRM specification). If your model uses these names, animations and retargeting will work reliably:
import { SimpleCharacter } from '@react-three/viverse'
export function MyCharacter() {
return <SimpleCharacter model={{ url: '/path/to/your-model.vrm' }} />
}
If your GLTF model does not use the standard VRM bone names, you can provide a boneMap to map your model's bone names to the VRM standard:
import { SimpleCharacter } from '@react-three/viverse'
const myBoneMap = {
'mixamorig:Hips': 'hips',
'mixamorig:Spine': 'spine',
// ... other bones
}
export function MyCharacter() {
return (
<SimpleCharacter
model={{
url: '/path/to/your-model.glb',
boneMap: myBoneMap
}}
/>
)
}
Adding Custom Animations
Your can replace the default animations of the SimpleCharacter component with files in any of these three supported animation formats:
- VRMA (VRM Animation) - The native VRM animation format
- FBX - Popular file format for character animations
- GLTF - Standard 3D format with animations
- Mixamo - deprecated - use remove
type: 'mixamo'and addboneMap: mixamoBoneMapinstead
Make sure to either use a bone map, e.g. when your bone names follow the mixamo naming conventions use the mixamoBoneMap or use the standard VRM bones for the animation amature as shown above under "VRM 1.0 humanoid bone names".
Each animation type can be configured individually:
<SimpleCharacter
animation={{
walk: {
url: '/animations/walking.fbx',
boneMap: mixamoBoneMap,
removeXZMovement: true,
scaleTime: 0.8,
},
run: {
url: '/animations/running.vrma',
},
idle: {
url: '/animations/idle.gltf',
trimTime: { start: 0.5, end: 3.0 },
},
}}
/>
You can customize any of these animation slots:
walk- Walking animationrun- Running animationidle- Standing idle animationjumpStart- Beginning of jumpjumpUp- Ascending during jumpjumpLoop- Mid-air loop animationjumpDown- Landing animation