Expression Parameter Mismatching

In typical VRChat Avatars 3.0 creation, VRChat expression parameters are expected to be set as the same parameter type (Bool, Int, Float) as their respective local animator parameter counterparts.

However, parameters between your Expression Parameters vs your local animator parameters can have mismatched parameter types and still function. This behaviour differs from type to type, and is documented below.

A parameter labeled  added to VRChat Expression Parameters as a

A parameter labeled Toggle added to VRChat Expression Parameters as a Bool

A parameter labeled  added to local animator parameters as a

A parameter labeled Toggle added to local animator parameters as a Float


Verified Parameter Mismatch Behaviour:

Expression Parameter Bool:

Animator Controller Parameter Expression Bool = False Expression Bool = True
Bool → Bool Bool = False Bool = True
Bool → Int Int = 0 Int = 1
Bool → Float Float = 0.0 Float = 1.0

Expression Parameter Int:

Animator Controller Parameter Behaviour
Int → Bool Any Int value that isn’t 0 sets bool to True
Int → Int Expected Behaviour
Int → Float Straight Conversion: Ex: Int = 2 → Float = 2.0

Expression Parameter Float:

Animator Controller Parameter Behaviour
Float → Bool Any Float value that isn’t 0 sets bool to True
Float → Int Rounded Conversion: ≥0.5 → 1 : \<0.5 → 0
Float → Float Expected Behaviour

Why does mismatching work?

Unity Animators use floats on the C# back-end regardless of parameter type, while VRChat uses SBytes instead of bools, ints, or floats.

The Animator window and VRCSDK themselves makes the user experience simpler by allowing you to select the parameter types from the interface.

In this sense, the parameters are not being casted but mismatched.

Mismatching parameters also works with the VRChat native parameters.


Testing in Unity

At this time of writing:

Av3Emulator has implemented the above parameter mismatching behaviour.

Gesture Manager has implemented the above parameter mismatching behaviour for all parameters but vrc builtin parameters, but is working on that for their 3.8.9 release.