Avatar Tips #8

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).

  1. The "Hat Toggle" menu itemPressing it sets HatOn to true
  2. Parameter HatOnBool (true or false)
  3. FX layer HatMoves from OFF to ON
  4. Clip Hat_ONWrites 1 to Hat's Is Active
  5. 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.

  1. In the Project window, right-click MyGimmicks/Hat, choose Create → Animation, and make a clip named Hat_ON. Make Hat_OFF the same way. You'll record what goes inside them in the next section. You make them now so you can put them in states.
  2. Right-click the same folder, choose Create → Animator Controller, and name it Hat_FX. (In some Unity versions, it's inside Create → Animation.)
  3. Double-click Hat_FX. The Animator window (Window → Animation → Animator) opens.
  4. Click the Layers tab at the top left. There's one layer, Base Layer. Leave it empty. You won't use it.
  5. Click the + to the right of Layers to add a layer. Name it Hat.
  6. Click the gear to the right of Hat and set Weight to 1. New layers are created with a Weight of 0. At 0, the layer writes nothing.
  7. Click the Parameters tab at the top left, click +, and choose Bool. Name it HatOn. It must match the name you'll put in the menu later, down to upper and lower case.
  8. Go back to the Layers tab and select the Hat layer. Drag Hat_OFF from the Project window onto an empty spot in the Animator window. A state named Hat_OFF appears. The first state you place turns orange. It's the state this layer enters first.
  9. Then drag in Hat_ON to make another state. This one is gray.
  10. If Hat_ON turned orange instead, right-click Hat_OFF and choose Set as Layer Default State.
Recreated view: the Animator window (Hat_FX). The layout and look are simplified. Names are examples.
  1. Set Weight to 1 from the gear. At 0, nothing changes when you press the menu.
  2. This is a Bool parameter. The checkbox shows its current value (false).
  3. 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.

  1. 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).
  2. In the Hierarchy, select the top of your avatar (the object with the VRC Avatar Descriptor). In the Inspector, drag Hat_FX from the Project window into the Controller field of the Animator. Put it there only while you record. The Animation window can only open clips from the controller in the selected avatar's Animator.
  3. Open the Animation window (Window → Animation → Animation). In the clip name field at the top left, choose Hat_ON.
  4. Click the red record button. Then select Hat in the Hierarchy and check the box to the left of its name in the Inspector. A Hat : Is Active row appears in the Animation window, with a key (a diamond) at frame 0. Click the record button again to stop.
  5. Switch the clip name field to Hat_OFF and record the same way. This time, check the box and then uncheck it, so you get a key where Hat : Is Active is 0 (off).
  6. When you're done recording, make sure Hat is unchecked (back to how it was before recording). Also put the Controller field of the Animator on 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 choose None.

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.

#7 Making animations

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.

  1. Right-click Hat_OFF, choose Make Transition, and then click Hat_ON. A white arrow appears.
  2. Click the arrow to select it. The transition settings appear in the Inspector.
  3. Uncheck Has Exit Time.
  4. Click the triangle to the left of Settings to open it, and set Transition Duration to 0.
  5. Click the + under Conditions at the bottom. Make sure the left field says HatOn and the right field says true.
  6. Draw an arrow from Hat_ON to Hat_OFF the same way. Uncheck Has Exit Time, set Transition Duration to 0, and set the Conditions to HatOn is false.
  7. Select the Hat_OFF and Hat_ON states one at a time, and look at the Write Defaults checkbox in the Inspector. Make both the same. If you hook it up with MA, MA will match it to your avatar later.
Recreated view: Unity's Inspector (the transition from Hat_OFF to Hat_ON). The layout and look are simplified. Names are examples.
  1. With this unchecked, the state switches the moment the condition is met.
  2. At 0, it goes straight to the next clip without blending it with the previous one.
  3. When HatOn becomes true, the layer follows this arrow to Hat_ON.

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

  1. If you don't have MA yet, add it with VCC or ALCOM (#3 Dressing your avatar).
  2. In the Hierarchy, right-click the top of your avatar and choose Create Empty to make an empty object. Name it Hat Toggle. This is also the name that shows in the menu.
  3. With Hat Toggle selected, click Add Component in the Inspector, search for MA Merge Animator, and add it.
  4. Drag Hat_FX from the Project window into the Animator to merge field.
  5. Set Layer Type to FX.
  6. Set Path Mode to Absolute, because you recorded the clips from the top of the avatar. With Relative, the paths are read as seen from this Hat Toggle object, and the hat can't be found.
  7. Check Match Avatar Write Defaults. It matches the states' Write Defaults to your avatar's FX.
Recreated view: MA Merge Animator on the Hat Toggle object (English display). The layout and look are simplified. Names are examples.
  1. The controller you want to hook up. Its layers are added to FX.
  2. Use Absolute for clips recorded from the top of the avatar. If you recorded children of the Hat Toggle object, use Relative.
  3. 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

  1. Select your avatar in the Hierarchy. In the Inspector, find Playable Layers on the VRC Avatar Descriptor and check which controller is in FX.
  2. Select that controller in the Project window and press Ctrl + D to duplicate it. Put the duplicate into the FX field of the VRC Avatar Descriptor. This keeps the original file safe.
  3. Open the duplicated controller and add the Hat layer (Weight 1), the HatOn parameter, and the two states and transitions, following the steps in this tip.
  4. Match the states' Write Defaults to the other states in the same FX. If ON and OFF are mixed, it's hard to tell which values stay.
  5. Add the parameter and the menu item to the Parameters and Menu files set under Expressions on 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.

  1. Select the Hat Toggle object and add MA Parameters from Add Component.
  2. Click the button that adds a parameter, and type HatOn as the name. Make it match the Animator parameter exactly, including upper and lower case.
  3. Set the type to Bool.
  4. Leave Default Value (the starting value) off (false, 0).
  5. Check Saved and Synced. The table below shows what they mean.
Recreated view: MA Parameters on the Hat Toggle object (English display). The layout and look are simplified. Names are examples.
  1. Use the same name and type as HatOn in the Animator.
  2. Remembers whether it's on or off, even when you change worlds or switch avatars and come back.
  3. Sends the value to other people. If unchecked, only you can see the hat.
SettingWith itWithout it
Saved (remember)Keeps the last value, even when you change worlds or switch avatars and come backGoes 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 bitChanges 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).

Finally, add a "Hat Toggle" item to the menu you open in VRChat (the Expressions Menu). #6 How the Animator works explains how the menu and parameters relate.

  1. Select the Hat Toggle object and add MA Menu Installer from Add Component. This component decides where in the menu the item goes. If you don't choose anything, it goes in the top menu.
  2. Next, add MA Menu Item from Add Component. This component becomes one item in the menu.
  3. Set Type to Toggle. Each press switches between on and off.
  4. Type HatOn in Parameter (or pick it from the list if you can).
  5. Leave Value at 1. When a Toggle turns on, it sets the Parameter to this value. When it turns off, it sets it back to 0. For a Bool, 1 is true and 0 is false.
Recreated view: MA Menu Installer and MA Menu Item on the Hat Toggle object (English display). The layout and look are simplified. Names are examples.
  1. Each press switches between on and off.
  2. Use the same name as in the Animator and MA Parameters. If even one character is different, it won't work.
  • The name shown in the menu is the object's name (Hat Toggle). You can add an icon too.
  • Depending on the MA version, MA Menu Item also has fields like Saved. This tip uses the settings you made in MA Parameters.
  • A menu can hold up to 8 items. When it's full, group items into a Sub Menu (an item that opens another menu inside).
  • When you add it to your avatar's FX directly, select the file in Menu under Expressions on the VRC Avatar Descriptor, and click Add Control in the Inspector. Enter "Hat Toggle" in Name, Toggle in Type, and HatOn in Parameter. For details, see VRChat's Expressions Menu 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

Expressions Menu
How you built it

"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.

  1. From Unity's top menu, choose Tools → Gesture Manager Emulator. An object named GestureManager appears in the scene. (The menu location and name may differ by version.)
  2. 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.
  3. Select GestureManager in the Hierarchy. The same round menu as in VRChat appears in the Inspector.
  4. Open Expressions and press Hat Toggle. Check that the hat appears in the Scene or Game view. Press it again and check that it disappears.
  5. If it doesn't work, check whether HatOn changes 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.
  6. Press the Play button again to stop. Settings you changed in Play mode go back when you stop.

Upload and check

  1. Upload from the VRChat SDK Builder. The steps are the same as in #2 How to upload.
  2. Wear the avatar in VRChat, open Expressions in the Action Menu, and press Hat Toggle.
  3. Change worlds, or switch avatars and come back, to check that the on/off state is kept (Saved).
  4. 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

What happens
The hat shows on your screen, but your friends can't see it.
Cause
Synced isn't checked on the parameter. Or the other person's Safety settings are blocking animations.
Fix
Check Synced and upload again. Ask the other person to check their own settings.

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

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.

All Avatar Tips