Building a menu toggle
Build a gimmick that shows and hides a hat from the menu, starting from the Animator. This tip walks you through it one click at a time: the on and off clips, the controller and layer, transitions, the parameter, the menu, and hooking it all up to your avatar.
Published · Covers Unity's Built-in Render Pipeline and VRChat avatars (Avatars 3.0). Up to date as of November 2026.
When to read this
- You want to show and hide accessories like a hat, glasses, or wings from the menu.
- You've been using Modular Avatar's Create Toggle, but you want to know what happens inside it and build one yourself.
- You want to hook up an Animator you built without breaking your avatar.
- Your toggle lags a beat, resets when you change worlds, or other people can't see it.
This tip assumes you've read #6 How the Animator works and #7 Making animations. Those tips explain what layers, states, transitions, and parameters are.
What you'll build
You'll turn a hat on your avatar's head (named Hat in the Hierarchy) on and off with a "Hat Toggle" item in the Expressions Menu (the menu you open in VRChat). The names are examples. Use the name of your own accessory instead.
You'll make five things: two clips, one controller, one parameter, and one menu item. At the end, you'll hook them up to your avatar with Modular Avatar (MA).
- The "Hat Toggle" menu itemPressing it sets HatOn to true
- Parameter HatOnBool (true or false)
- FX layer HatMoves from OFF to ON
- Clip Hat_ONWrites 1 to Hat's Is Active
- ResultThe hat appears
Before you start, back up your avatar's folder or the whole Unity project, so you can go back if something goes wrong.
Keep the files you make in your own folder, separate from the avatar's folder. For example, right-click Assets in the Project window, choose Create → Folder, and make MyGimmicks/Hat. This way, updating the avatar won't overwrite them.
Create the controller and layer
Create an Animator Controller (a controller) just for the hat. Don't touch the FX controller your avatar already has. For what FX and the other layers do, see #6 How the Animator works.
- In the Project window, right-click
MyGimmicks/Hat, chooseCreate → Animation, and make a clip namedHat_ON. MakeHat_OFFthe same way. You'll record what goes inside them in the next section. You make them now so you can put them in states. - Right-click the same folder, choose
Create → Animator Controller, and name itHat_FX. (In some Unity versions, it's insideCreate → Animation.) - Double-click
Hat_FX. The Animator window (Window → Animation → Animator) opens. - Click the
Layerstab at the top left. There's one layer,Base Layer. Leave it empty. You won't use it. - Click the
+to the right ofLayersto add a layer. Name itHat. - Click the gear to the right of
Hatand setWeightto 1. New layers are created with a Weight of 0. At 0, the layer writes nothing. - Click the
Parameterstab at the top left, click+, and chooseBool. Name itHatOn. It must match the name you'll put in the menu later, down to upper and lower case. - Go back to the
Layerstab and select theHatlayer. DragHat_OFFfrom the Project window onto an empty spot in the Animator window. A state namedHat_OFFappears. The first state you place turns orange. It's the state this layer enters first. - Then drag in
Hat_ONto make another state. This one is gray. - If
Hat_ONturned orange instead, right-clickHat_OFFand chooseSet as Layer Default State.
LayersParameters
Inside the Hat layer
LayersParameters
- Set Weight to 1 from the gear. At 0, nothing changes when you press the menu.
- This is a Bool parameter. The checkbox shows its current value (false).
- The layer starts from the orange state. The hat starts hidden, so make Hat_OFF the orange one.
Record the on and off clips
Record what goes inside the clip that shows the hat and the clip that hides it. #7 Making animations explains recording in detail.
- In the Hierarchy, select
Hat, and uncheck the box to the left of its name at the top of the Inspector to turn it off. This means the hat starts hidden (it matches the Default you'll set later). - In the Hierarchy, select the top of your avatar (the object with the VRC Avatar Descriptor). In the Inspector, drag
Hat_FXfrom the Project window into theControllerfield of theAnimator. Put it there only while you record. The Animation window can only open clips from the controller in the selected avatar's Animator. - Open the Animation window (
Window → Animation → Animation). In the clip name field at the top left, chooseHat_ON. - Click the red record button. Then select
Hatin the Hierarchy and check the box to the left of its name in the Inspector. AHat : Is Activerow appears in the Animation window, with a key (a diamond) at frame 0. Click the record button again to stop. - Switch the clip name field to
Hat_OFFand record the same way. This time, check the box and then uncheck it, so you get a key whereHat : Is Activeis 0 (off). - When you're done recording, make sure
Hatis unchecked (back to how it was before recording). Also put theControllerfield of theAnimatoron the top of your avatar back the way it was. If it was empty, click the small circle to the right of the field and chooseNone.
You make an off clip too, so the toggle works no matter how Write Defaults (what happens to values a clip doesn't write) is set. If the off state has a clip that writes nothing, the hat stays on for avatars with Write Defaults OFF. If both the on and off clips write Is Active, it works with either setting.
Start recording after you select the top of your avatar. The clip stores "where Hat is, as seen from the top of the avatar" (the path). You'll use this path later when you hook it up with MA.
Set up the transitions
Draw two arrows (transitions): one from OFF to ON, and one from ON to OFF. Here you decide when to switch, and how.
- Right-click
Hat_OFF, chooseMake Transition, and then clickHat_ON. A white arrow appears. - Click the arrow to select it. The transition settings appear in the Inspector.
- Uncheck
Has Exit Time. - Click the triangle to the left of
Settingsto open it, and setTransition Durationto 0. - Click the
+underConditionsat the bottom. Make sure the left field saysHatOnand the right field saystrue. - Draw an arrow from
Hat_ONtoHat_OFFthe same way. UncheckHas Exit Time, setTransition Durationto 0, and set theConditionstoHatOnisfalse. - Select the
Hat_OFFandHat_ONstates one at a time, and look at theWrite Defaultscheckbox in the Inspector. Make both the same. If you hook it up with MA, MA will match it to your avatar later.
▼ Settings
Conditions
Why uncheck Has Exit Time and set Duration to 0?
When Has Exit Time is checked, the state waits for the current clip to reach a set point before it switches. It lags a beat after you press the menu.
Transition Duration is how many seconds it takes to blend from the previous clip into the next one. Above 0, colors and BlendShapes change gradually. Turning an object on or off has no in-between, so it just snaps at some point during the blend. It only looks late.
A toggle should feel like "press it and it changes right away," so uncheck Has Exit Time and set Duration to 0. When Has Exit Time is unchecked, Unity warns you if there are no Conditions. Always add a condition.
Hook it up to your avatar
Hook the controller you made up to your avatar's FX. There are two ways to do it.
- Hook it up with Modular Avatar (recommended)
- Add MA components to an object inside your avatar, and MA adds the Hat layer to your avatar's FX when you upload. It doesn't rewrite your avatar's files, so it won't disappear when you update the avatar. When you don't need it anymore, just delete the object.
- Add it to your avatar's FX directly
- Add the Hat layer to your avatar's FX controller yourself. You don't need MA, but it rewrites your avatar's files. It may disappear when you update the avatar, and it could break the original gimmicks.
Steps to hook it up with Modular Avatar
- If you don't have MA yet, add it with VCC or ALCOM (#3 Dressing your avatar).
- In the Hierarchy, right-click the top of your avatar and choose
Create Emptyto make an empty object. Name itHat Toggle. This is also the name that shows in the menu. - With
Hat Toggleselected, clickAdd Componentin the Inspector, search forMA Merge Animator, and add it. - Drag
Hat_FXfrom the Project window into theAnimator to mergefield. - Set
Layer TypetoFX. - Set
Path ModetoAbsolute, because you recorded the clips from the top of the avatar. WithRelative, the paths are read as seen from thisHat Toggleobject, and the hat can't be found. - Check
Match Avatar Write Defaults. It matches the states' Write Defaults to your avatar's FX.
▼ MA Merge Animator
- The controller you want to hook up. Its layers are added to FX.
- Use Absolute for clips recorded from the top of the avatar. If you recorded children of the Hat Toggle object, use Relative.
- MA checks whether your avatar uses Write Defaults ON or OFF, and matches the added states to it.
MA can also show its interface in Japanese. This tip uses the names from the English display.
Adding it to your avatar's FX directly
- Select your avatar in the Hierarchy. In the Inspector, find
Playable Layerson the VRC Avatar Descriptor and check which controller is in FX. - Select that controller in the Project window and press
Ctrl + Dto duplicate it. Put the duplicate into the FX field of the VRC Avatar Descriptor. This keeps the original file safe. - Open the duplicated controller and add the
Hatlayer (Weight 1), theHatOnparameter, and the two states and transitions, following the steps in this tip. - Match the states'
Write Defaultsto the other states in the same FX. If ON and OFF are mixed, it's hard to tell which values stay. - Add the parameter and the menu item to the Parameters and Menu files set under
Expressionson the VRC Avatar Descriptor (see the next two sections).
When you update the avatar, the FX and menu files may be overwritten, and what you added may disappear. You'd have to add it again every time, so we recommend hooking it up with MA. For more on Write Defaults, see #13 It looks different in Unity and VRChat.
Tell VRChat about the parameter (Expression Parameters)
Just creating HatOn in the Animator doesn't tell VRChat about it. Only after you register it in Expression Parameters can the menu change it, and only then is it sent to other people. When you use MA, register it with MA Parameters. #6 How the Animator works explains how the two kinds of parameters relate.
- Select the
Hat Toggleobject and addMA ParametersfromAdd Component. - Click the button that adds a parameter, and type
HatOnas the name. Make it match the Animator parameter exactly, including upper and lower case. - Set the type to
Bool. - Leave
Default Value(the starting value) off (false, 0). - Check
SavedandSynced. The table below shows what they mean.
▼ MA Parameters
- Use the same name and type as HatOn in the Animator.
- Remembers whether it's on or off, even when you change worlds or switch avatars and come back.
- Sends the value to other people. If unchecked, only you can see the hat.
| Setting | With it | Without it |
|---|---|---|
| Saved (remember) | Keeps the last value, even when you change worlds or switch avatars and come back | Goes back to Default when you change worlds or switch avatars |
| Synced (sync) | The value is sent to others, so they see the same thing. Uses the sync budget (256 bits). A Bool takes 1 bit | Changes only on your screen. Others keep seeing Default. Uses none of the budget |
| Default (starting value) | The value used the first time you wear the avatar, and the value it goes back to when Saved is off. To show the hat from the start, set it to on (true, 1) | — |
If you set Default to on, turn on Hat in the Hierarchy too. Then what you see in Unity matches the starting value.
When you add it to your avatar's FX directly, select the file in Parameters under Expressions on the VRC Avatar Descriptor. Add a row in the Inspector, and set the name HatOn, the type Bool, and Default, Saved, and Synced the same way.
For the detailed rules on parameters, see VRChat's Animator Parameters page (opens in a new tab).
Try it out
Press "Hat Toggle" in the menu, then try unchecking the build steps. You'll see how your look changes for you and for others, and why.
You, as you see yourself
You, as others see you
"Hat Toggle" is off in the menu, so HatOn is false. The layer is in the Hat_OFF state, and the hat is hidden.
You see no hat. Others see no hat.
Test it with Gesture Manager
Before you upload, test it inside Unity. Gesture Manager is a tool that imitates VRChat's menu and hand gestures when you press Play in Unity. Add it to your project with VCC or ALCOM.
- From Unity's top menu, choose
Tools → Gesture Manager Emulator. An object namedGestureManagerappears in the scene. (The menu location and name may differ by version.) - Press the Play button (▶) at the top. MA adds the Hat layer to FX at this point, so the avatar in Play mode is hooked up the same way as when you upload.
- Select
GestureManagerin the Hierarchy. The same round menu as in VRChat appears in the Inspector. - Open
Expressionsand pressHat Toggle. Check that the hat appears in the Scene or Game view. Press it again and check that it disappears. - If it doesn't work, check whether
HatOnchanges in Gesture Manager's parameter view (its name differs by version). If it doesn't change, suspect the menu or the parameter. If it changes but the hat doesn't appear, suspect the layer's Weight or the clip's path. - Press the Play button again to stop. Settings you changed in Play mode go back when you stop.
Upload and check
- Upload from the VRChat SDK Builder. The steps are the same as in #2 How to upload.
- Wear the avatar in VRChat, open
Expressionsin the Action Menu, and pressHat Toggle. - Change worlds, or switch avatars and come back, to check that the on/off state is kept (Saved).
- To be sure others can see it too (Synced), ask a friend to look.
Common problems and fixes
Nothing happens when you press the menu
- What happens
- You can press "Hat Toggle" in the menu, but the hat doesn't appear. In Gesture Manager, HatOn does change.
- Cause
- The Hat layer's Weight is still 0. Or the clip's path doesn't point to the hat (for example, MA's Path Mode is wrong).
- Fix
- Set Weight to 1 from the gear. Open the clip in the Animation window, check that no row is yellow and marked Missing, and set Path Mode to match how you recorded.
HatOn doesn't change
- What happens
- Even when you press the menu, HatOn stays false in Gesture Manager.
- Cause
- The parameter name is different somewhere between the menu's Parameter, MA Parameters, and the Animator. Upper and lower case, and spaces at the start or end, also count as differences.
- Fix
- Copy and paste the name so it matches in all three places. Match the type (Bool) too.
It switches a beat late
- What happens
- The hat appears a little after you press. It's late when it disappears, too.
- Cause
- Has Exit Time is checked on a transition, or Transition Duration is above 0.
- Fix
- On both arrows, uncheck Has Exit Time and set Transition Duration to 0.
It keeps turning on and off by itself
- What happens
- The hat blinks on and off even though you didn't press the menu.
- Cause
- The transitions have no Conditions, so they move on Has Exit Time alone.
- Fix
- Add the conditions: HatOn is true for OFF to ON, and HatOn is false for ON to OFF.
It resets when you change worlds
- What happens
- You turned the hat on, but it's gone after you change worlds, or switch avatars and come back.
- Cause
- Saved isn't checked on the parameter.
- Fix
- Check Saved in MA Parameters (or in Expression Parameters, if you added it directly), and upload again.
Only you can see it
The hat won't go away when you turn it off
- What happens
- Once you turn it on, the hat stays even after you turn it off.
- Cause
- The Hat_OFF clip has no Is Active row, and Write Defaults is OFF, so the value from when it was on stays.
- Fix
- Add a key to the Hat_OFF clip that writes 0 to Hat's Is Active.
Things to watch out for
- Try not to rewrite the FX and menu files your avatar came with. If you hook things up with MA, your gimmicks stay even after you update the avatar.
- Give your parameter a name that doesn't clash with the avatar's other gimmicks. If two share a name, both gimmicks move together.
- Don't mix Write Defaults ON and OFF in the same controller. MA's Match Avatar Write Defaults can match it to your avatar.
- Synced parameters use the sync budget (256 bits in total). For things only you need to see, uncheck Synced.
- A menu can hold up to 8 items. If you have a lot of accessories, group them into a Sub Menu.
- Don't move Humanoid bones (how the arms or neck bend) with FX clips. Use FX clips for looks: turning objects on and off, BlendShapes, materials, and so on.
Summary
- Make both an on clip and an off clip. Then it works however Write Defaults is set.
- Add a layer to your own controller and set its Weight to 1. Add a Bool parameter and two states.
- On the transitions, uncheck Has Exit Time, set Transition Duration to 0, and add conditions.
- Register the parameter in Expression Parameters (MA Parameters). Saved remembers it, Synced sends it to others, and Default is the starting value.
- Use MA Merge Animator, MA Parameters, MA Menu Installer, and MA Menu Item to hook it up without rewriting your avatar's files.
- Test it with Gesture Manager, then upload.
In the next tip, #9 Switching in steps and changing gradually, you'll build a gimmick that picks one of several outfits, and one that changes gradually as you turn a dial.