How to make toggles and radials for VRChat avatars using Direct Blendtrees (The most optimised way)
Table of Contents
Introduction
In this tutorial, you will learn how to create optimized toggles and radial controls for VRChat avatars using Direct Blendtrees. This method, developed by VR Labs, enhances the performance and functionality of avatar controls. Whether you're a beginner or an experienced user, this guide will take you through the entire process step by step.
Chapter 1: Creating the Avatar Parameters, Menu and FX Layer
-
Set Up Unity Environment
- Open Unity and load your avatar model.
- Create an Animator Controller for the FX Layer.
- Create a VRChat Menu and VRChat Avatar Parameters.
-
Define Parameters
- You will create three types of toggles:
- Cube Toggle: A Boolean toggle for turning a cube on and off.
- Hue Shift: A float for controlling hair color.
- Pants Material: A float for switching between three different materials.
- Name your parameters as follows:
Cube Toggle
(Boolean)U Shift
(Float)Pants Material
(Float)
- You will create three types of toggles:
-
Set Up Menu Controls
- In the VRChat Menu, create:
- A toggle for
Cube Toggle
. - Two radial controls for
U Shift
andPants Material
.
- A toggle for
- In the VRChat Menu, create:
Chapter 2: Creating the Animations for the Toggles and Radials
-
Copy Avatar for Animation
- Duplicate your avatar to create a separate instance for animation.
-
Create Animation for Cube Toggle
- Select the cube and start recording an animation.
- Disable the cube during the recording.
- Copy the properties needed for the toggle.
-
Animate Hue Shift
- Record the hue shift animation by adjusting the hair color.
- Use the left-click and shift-click method to select all relevant properties and copy them.
- Adjust values from 0 to 1.
-
Animate Pants Material Swaps
- Create three animations for the various pant materials.
- Drag and drop the material changes into their respective animation clips.
-
Save Animations
- Once all animations are complete, save your work in Unity.
Chapter 3: Adding Parameters to the FX Layer Correctly
- Add Parameters to FX Layer
- Open the FX Layer and add your parameters.
- For the Cube Toggle, add it as a float, not a Boolean.
- Include additional floats for:
Pants Material
FX Weight
(to control the overall blending)
Chapter 4: Creating the Blendtree for All the Toggles
-
Set Up Blendtree
- In the FX Layer, create a Blendtree and ensure that the default settings are enabled.
- Set the blend type to Direct.
-
Add Toggles to Blendtree
- Add three branches for the toggles:
- Cube Toggle: Add two motion fields for on and off states.
- Hue Shift: Add two motion fields for hair color.
- Pants Material: Add three motion fields for material swaps.
- Confirm that the parameter for each branch is set to
FX Weight
and its value to 1.
- Add three branches for the toggles:
Chapter 5: Testing in Unity Using the Avatar Emulator
-
Enable Avatar Emulator
- Go to Tools and enable the Avatar Emulator.
- Control your avatar to test the toggles and radial controls.
-
Check Functionality
- Test the functionality of each control:
- Ensure the cube toggle works as intended.
- Check the hue shifts and material swaps for pants.
- Test the functionality of each control:
Chapter 6: Testing In-Game
- Verify In-Game Performance
- Launch VRChat to see how your toggles and radials perform in the game.
- Confirm that the cube toggle, hue shifts, and material changes work smoothly without delays.
Conclusion
You have now successfully created optimized toggles and radial controls for your VRChat avatar using Direct Blendtrees. Remember, this method significantly enhances the performance of your avatar controls. For further improvements or troubleshooting, refer to the VR Labs documentation linked in the description. Happy creating!