Animator Parameters
This document is written with the assumption that you know a bit about Unity Animators.
This is a list of Parameters (case-sensitive) that can be added to any Playable Layer (animation controller) and change across all Playable Layers that include this parameter. User created parameters that are not in this list will exist only locally within that animation controller and are not currently changeable by the avatar.
You'll need to add these to your Playable Layer animators to use them. They are case-sensitive!
You should assume that parameter values may change. If you "dead-end" your animators, which means you don't have an "exit" in any particular branch, you may end up having a broken avatar.
Parameters
Name | Description | Type | Sync |
---|---|---|---|
IsLocal | True if the avatar is being worn locally, false otherwise | Bool | None |
PreviewMode | Returns 1 if the avatar is being previewed, 0 if it is not | Int | None |
Viseme | Oculus viseme index (0-14 ). When using Jawbone/Jawflap, range is 0-100 indicating volume | Int | Speech |
Voice | Microphone volume (0.0-1.0 ) | Float | Speech |
GestureLeft | Gesture from L hand control (0-7) | Int | IK |
GestureRight | Gesture from R hand control (0-7) | Int | IK |
GestureLeftWeight | Analog trigger L (0.0-1.0)† | Float | Playable |
GestureRightWeight | Analog trigger R (0.0-1.0)† | Float | Playable |
AngularY | Angular velocity on the Y axis | Float | IK |
VelocityX | Lateral move speed in m/s | Float | IK |
VelocityY | Vertical move speed in m/s | Float | IK |
VelocityZ | Forward move speed in m/s | Float | IK |
VelocityMagnitude | Total magnitude of velocity | Float | IK |
Upright | How "upright" you are. 0 is prone, 1 is standing straight up | Float | IK |
Grounded | True if player touching ground | Bool | IK |
Seated | True if player in station | Bool | IK |
AFK | Is player unavailable (HMD proximity sensor / End key) | Bool | IK |
Expression1 - Expression16 | User defined param, Int (0 -255 ) or Float (-1.0 -1.0 ) | Int / Float | IK or Playable |
TrackingType | See description below | Int | Playable |
VRMode | Returns 1 if the user is in VR, 0 if they are not | Int | IK |
MuteSelf | Returns true if the user has muted themselves, false if unmuted | Bool | Playable |
InStation | Returns true if the user is in a station, false if not | Bool | IK |
Earmuffs | Returns true if the user's Earmuff feature is on, false if not | Bool | Playable |
IsOnFriendsList | Returns true if the user viewing the avatar is friends with the user wearing it. false locally. | Bool | Other |
AvatarVersion | Returns 3 if the avatar was built using VRChat's SDK3 (2020.3.2) or later, 0 if not. | Int | IK |
"Supine" and "GroundProximity" are visible in the Debug display, but are not implemented yet. They currently do nothing and never change values.
† GestureLeftWeight and GestureRightWeight go from 0.0 to 1.0 in various gestures depending on the trigger pull. For example, if you make a fist but don't pull the trigger on the left hand, GestureLeft will be 1, but GestureLeftWeight will be 0.0. When you start pulling the trigger, it will climb from 0.0 towards 1.0. This can be used to create "analog" gestures or conditionally detect various things.
Avatar Scaling Parameters
Name | Description | Type | Sync |
---|---|---|---|
ScaleModified | Returns true if the user is scaled using avatar scaling, false if the avatar is at its default size. | Bool | Playable |
ScaleFactor | Relation between the avatar's default height and the current height. An avatar with a default eye-height of 1m scaled to 2m will report 2 . | Float | Playable |
ScaleFactorInverse | Inverse relation (1/x ) between the avatar's default height and the current height. An avatar with a default eye-height of 1m scaled to 2m will report 0.5 . Might be inaccurate at extremes. | Float | Playable |
EyeHeightAsMeters | The avatar's eye height in meters. | Float | Playable |
EyeHeightAsPercent | Relation of the avatar's eye height in meters relative to the default scaling limits (0.2 -5.0 ). An avatar scaled to 2m will report (2.0 - 0.2) / (5.0 - 0.2) = 0.375 . | Float | Playable |
All of these parameters are read-only.
Parameter Types
You have access to three types of variable when defining your parameters in your Parameters object.
You can use up to a total of 256 bits of "memory". This isn't strictly memory in the sense of memory usage of the avatar, but has to do with the bandwidth you use when syncing parameters.
Parameter Type | Range | Memory Usage | Notes |
---|---|---|---|
int | 0 -255 | 8 bits | Unsigned 8-bit int. |
float | -1.0 to 1.0 | 8 bits | Signed 8-bit fixed-point decimal†. |
bool | True or False | 1 bit |
† Remotely synced float
values have 255 possible values, giving a precision of 1/127
over the network, and can store -1.0
, 0.0
, and 1.0
precisely. When updated locally, such as with OSC, float values are stored as native (32-bit) floating-point values in animators.
GestureLeft and GestureRight Values
GestureLeft and GestureRight use these as their values:
Index | Gesture |
---|---|
0 | Neutral |
1 | Fist |
2 | HandOpen |
3 | FingerPoint |
4 | Victory |
5 | RockNRoll |
6 | HandGun |
7 | ThumbsUp |
Viseme Values
We use the Oculus viseme index, top to bottom, where sil
is 0. For reference:
Viseme Parameter | Viseme |
---|---|
0 | sil |
1 | pp |
2 | ff |
3 | th |
4 | dd |
5 | kk |
6 | ch |
7 | ss |
8 | nn |
9 | rr |
10 | aa |
11 | e |
12 | i |
13 | o |
14 | u |
Sync Types
- Speech - Only used for visemes, is driven by the Oculus Lipsync output parameters depending on your speech. Updated locally, not directly synced (because its driven by audio)
- Playable - A slower sync mode meant to synchronize longer-running animation states. Updates every 0.1 to 1 seconds as needed based on parameter changes (1 to 10 updates per second), but you shouldn't rely on it for fast sync.
- IK - A faster sync mode meant to synchronize frequently-changing values. Updates continuously every 0.1 seconds (10 updates per second), and interpolates
float
values locally for remote users. Depending on the parameter, this may also just be calculated based on the avatar's locally rendered IK state.
When an Expression Parameter is in-use in a Puppet menu, it automatically swaps from Playable to IK sync so you get the continuous update rate and smooth interpolation. When the menu is closed, it returns to Playable sync.
Driving Expression Parameters
In addition, Expression parameters can be "driven" to a value via State Behaviors. They can be set using the Avatar Parameter Driver
State Behavior on a state in an animator.
AFK State
The AFK state is triggered by:
- The user removing the headset and the HMD proximity sensor returning that the headset is not being worn
- A system menu is open. This depends on how the platform you're using delivers data when system menus are up-- for example, the Oculus Dash doesn't register as AFK, but SteamVR's menu does register as AFK. This is kind of a knock-on, and not a designed behavior.
- The user has pressed the End key, toggling the AFK state.