Constraints
VRChat provides its own custom constraints system, which allows bones on your avatar to move, rotate, and scale relative to other bones.
This is intended to be a like-for-like replacement of Unity's constraints system, with a few additional features based on how VRChat avatars typically use constraints. If you've never used constraints before, you may find it useful to refer to Unity's documentation for constraints.
You should use VRChat's constraints instead of Unity's when creating avatars. If your avatar contains any Unity constraints, they will be automatically converted into VRChat constraints when your avatar is loaded in-game, so using VRChat constraints directly will give you a more accurate representation of how your avatar will behave as well as a more accurate performance rank.
Constraint Types
VRChat currently provides the following constraint types, which are designed to work in the same way as Unity's six built-in constraints:
- VRCAimConstraint - Rotates the target transform so it aims towards the sources. You can customize which direction is treated as forwards.
- VRCLookAtConstraint - A simplified Aim Constraint that rotates the target transform to keep its positive Z axis facing towards the sources.
- VRCParentConstraint - Moves and rotates the target transform as if it were a child of its sources.
- VRCPositionConstraint - Changes the position of the target transform to match the positions of its sources.
- VRCRotationConstraint - Changes the rotation of the target transform to match the rotations of its sources.
- VRCScaleConstraint - Changes the scale of the target transform to match the scales of its sources.
Visit the links above for more information about the settings available for each constraint type.
Advanced Constraint Settings
The Advanced Settings foldout contains some additional functions provided by VRChat constraints.
Target Transform
The Target Transform
setting allows you to change the transform targeted by this constraint. By default, this setting is empty, and the constraint is applied to the transform that the constraint component is attached to. Note that changing this transform with an animation is not possible.
This may be useful if you'd like to keep all of the constraint components on your avatar in one place, or if you're setting up a system that uses constraints and you want it to be transferrable between different avatars.
Solve In Local Space
Normally, a constraint is solved in world space, which means it will match the world position/rotation/scale of its sources. If the Solve In Local Space
option is enabled, the constraint will match the local position/rotation/scale of its sources instead.
This can be useful in situations such as setting up additional fake limbs for avatars. You might, for example, have a chain of locally solved rotation constraints that refer to each bone of the avatar's real arm, which would then cause that chain to rotate around as the real arm does. This isn't limited to rotation constraints, however - all types can use local solving.
The video below illustrates the difference between globally and locally solved rotation constraints as an example. In this clip, the middle and right arrows each use rotation constraints to match the rotation of the left arrow, where the middle arrow uses world space solving and the right arrow uses local space solving. Notice how the world solved constraint always matches the rotation of the target in world space. In contrast, the locally solved constraint always matches the direction the target is facing relative to its parent bone.