Avatar Animation System
The U3D template includes a complete avatar system that takes any humanoid character and turns it into a fully animated multiplayer player. Walking, running, jumping, crouching, flying, swimming, and climbing all animate automatically and sync across all players in the session. The system is built on Unity 6 standards and Photon Fusion 2, and works in WebGL and WebXR.
🎯 Quick Access
Avatar setup: U3D_PlayerController prefab → U3DAvatarManager component → Avatar FBX field
Avatar Setup Process
The avatar system is part of the Universal Character Controller. The U3D_PlayerController prefab already has all the components you need — U3DAvatarManager, U3DNetworkedAnimator, and the supporting pieces — wired up and ready. To use a different avatar than the one that ships with the template, you change one field in the Inspector.
Where Avatars Come From
Anything rigged as a Unity humanoid works without modification. That includes the major avatar creation services and most animation marketplaces.
Two things to check before you assign
Rig type: Select the FBX in the Project window. In the Inspector, open the Rig tab. Animation Type should be set to Humanoid. If it's set to Generic or Legacy, change it to Humanoid and click Apply. The system needs the humanoid bone mapping to drive the animations correctly.
VR eye height (if your audience uses VR): Different humanoid rigs put the head bone in different places, which affects where the VR camera sits relative to the avatar's eyes. After assigning your avatar, test in VR and adjust the VR Eye Offset on U3D Player Controller if the view feels too low or too far back. Details below →
Animation System
One animator, one set of clips, eight states
The avatar's animations are driven by U3DAnimatorController, a Unity AnimatorController asset that ships with the template. It contains the eight movement states and the transitions between them. The clips assigned to each state determine how each movement looks.
How transitions happen
U3DNetworkedAnimator reads the player controller's state every frame on the client with state authority and writes animator parameters (IsMoving, IsCrouching, IsFlying, IsSwimming, IsClimbing, IsJumping, IsGrounded, MoveSpeed, MoveX, MoveY, JumpTrigger). Photon Fusion's NetworkMecanimAnimator then syncs those parameters to all other clients, so everyone sees the same animation state at the same time.
8 Core Animation States
The state machine covers the controller's full set of movement modes with eight distinct animation states. Transitions between them happen automatically based on what the player is doing.
VR Hand and Head Tracking
The avatar moves with the visitor's body
When a visitor enters your experience through WebXR, the avatar system gets two extra inputs from the headset: where the head is looking, and where the hands are. Both are wired up automatically and networked to other players in the session.
👁️ Adjusting eye height for custom avatars
VR places the camera at your avatar's eye position based on the head bone. Different humanoid rigs put the head bone in slightly different places, so for some avatars the camera will sit too low (looking at the neck) or too far back. There's one Inspector field to fix this:
U3D_PlayerController prefab → U3D Player Controller component → VR Eye Offset
Y moves the camera up and down. Increase it if the camera sits too low. Z moves the camera forward and back. Increase it to sit further inside the avatar's head, decrease it to sit further back. Adjust with the headset on until the view feels right at eye level — easiest to test by looking at a mirror in your scene, or by turning around to face your own avatar.
The default values work for the avatar that ships with the template. If you swap in a Ready Player Me, VRoid, Mixamo, or custom rig and the view feels off, this is the field to adjust.
What "automatic" actually means here
The hand and head tracking components are part of the U3D_PlayerController prefab. As long as you're using the standard prefab and your avatar is a humanoid rig, no setup is required for VR tracking — it activates the moment a visitor enters your experience through WebXR.
Customizing Animations
The eight states are defined in U3DAnimatorController, the AnimatorController asset at Assets/U3D/Scripts/Runtime/Avatar/U3DAnimatorController.controller. Each state has a clip assigned to it. To change how a movement looks, swap the clip in that state.
Swapping a clip for one state
Open U3DAnimatorController by double-clicking it. The Animator window shows the state machine with all eight states. Click the state whose clip you want to change — say, Walking. In the Inspector, the Motion field shows the current clip. Drag your replacement clip into that field. Save and play.
If your replacement clip's bone names match Unity's humanoid bone mapping, it'll work on any humanoid avatar without modification. Mixamo clips, Asset Store animations, and your own Blender exports all behave this way as long as Animation Type is set to Humanoid in their import settings.
Different look for different scenes
Duplicate U3DAnimatorController, give the copy a project-specific name, swap clips in the duplicate, and assign the duplicate to the U3DNetworkedAnimator's Animator Controller field on the player prefab. Original ships untouched, your project gets its own animation feel.
🛡️ Don't modify the parameters list
The animator parameters (IsMoving, IsCrouching, IsFlying, IsSwimming, IsGrounded, IsClimbing, IsJumping, MoveSpeed, MoveX, MoveY, JumpTrigger) are written by U3DNetworkedAnimator every tick. Renaming or removing them breaks the connection to the player controller's state. Adding new parameters is fine; changing the existing ones is not.