Skip to main content

Tutorial

This is the script to a video I never got around to recording. I apologize for the lack of pictures. To see my other tutorials, visit my YouTube channel.



Getting Started

First you want to download this tool from Gumroad. Type “0” into the payment box, then download and import the unitypackage. If for some reason an update to the VRChat SDK breaks this tool I will have a link in the description to a video that shows you how to create toggles the normal and tedious way.


I also wanted to give a shout out to this other extension because it essentially does the same thing with fewer options except it wasn’t working for me (it was able to toggle objects off, but not back on again). You still try it out yourself though.


After that these other things are optional but I’d still recommend installing them. You want the avatar 3.0 emulator so that you can test to make sure that your toggles work inside of unity before uploading your avatar. You can get that from either Github or Booth. After that I’d recommend getting this simple add-on that gives you custom icons for the VRC expression parameters and VRC expressions menu assets. There’s also an icon pack here for free. And lastly there’s an editor script that automatically switches to the scene view when you press the play button; just put it anywhere in your project and it’ll work. You can toggle that feature on and off by going to Tools>Switch To Scene View On Play.


       Simple Toggle

My scene already has an avatar set up and I’m going to make a duplicate of it since I don’t want to mess with the original avatar in case something goes wrong. To do that select your avatar game object, hold control and click the arrow to move it back, press control + D to duplicate it, and move it back forward. I will also append “toggles” to the end of its name.


I also want to make sure that I made a duplicate of the effects layer, the expressions menu, and the expressions parameters. With the avatar selected, scroll down to the FX layer, click on it, press Ctrl D and then press F2 to rename it, then drag it back into the FX slot. Do the same thing with the expressions menu and the expressions parameters.


If you don’t already have an expressions menu or expressions parameters, you can create them by right clicking in the project tab and going to Create>VRChat>Avatars. Note that using a custom expressions menu will remove the default emotes menu and to get that back you will have to create a new sub menu that looks like this emotes menu.


The way toggles work is that they play an animation when the button is pressed in the radial menu. If the object is already on, it plays an animation to turn the object off and vice versa. This tool will automatically generate the animations for us, but we have to create a folder to store them in. So go to an appropriate place in your project (like the animations folder if your model came with one), right click>Create>Folder and then rename it to Toggles. 

I have two different avatars in this project, so I have two sub folders in the toggles folder, one for each avatar.


Now click the object that you want to be able to toggle on and off, or and make sure it’s selected in the hierarchy. To enable the tool go up to the tools menu and click toggle creator. Since we have the object selected in the hierarchy it has already filled in the avatar and accessory object for us. 

Alternatively you can also right click on the game object that you want to toggle in the hierarchy and click either advanced toggle or toggle.


Note that you can hover over the labels in this new window and text will pop up to tell you what each option does.


Under the expressions menu I want the toggle that is generated to appear in a new sub menu. So click the plus icon next to the drop-down to create a new expressions menu slot. I’m going to call it clothes and I’m going to put this sub menu under the toggles folder. If you go back into the main menu, you can change the icon for the sub menu.


To create the toggle, 

  1. In the parameters section, under the expressions menu dropdown, select the submenu we created for toggles.

  2. Type in the name in menu, which will also fill in the parameter name.

  3. Select the icon in menu by clicking the circle on the right side of the input box to bring up the texture search, or drag an image into the box from the project tab. For this toggle, I will do the former and search for a muffler since this avatar came with a muffler icon.

  4. For this object, the muffler, if I toggle it off, I want it to stay that way if I change into a new world or change back into the avatar, so I will leave safe state on.

  5. I also want it to be a default part of the avatar if it reloads, so I will leave default state enabled.

  6. I want the folder for the new animations to be in the one that I created so I will navigate to that in the drop down.

  7. Then click create simple toggle, and you're done!


To preview this toggle in unity, 

  1. Go to the tools menu,

  2. click Gesture Menu Emulator,

  3. then click play. 

  4. With the the gesture manager prefab selected, 

  5. make sure that the controlling avatar is set to the one you put the toggle on. 

  6. Then navigate the expressions menu the same way you would in game. 

If it works here, then it should work in VRChat!



If you messed up creating the toggle, you should use the toggle remover by going to Tools>toggle remover. This automates the removal process.



Advanced Toggle

But what if you want to do more than just toggle an object on or off? That’s where advanced toggle comes in.



This avatar has a jacket but also has a shirt underneath. The shirt has a blendshape for the sleeves to squeeze around the arm when the jacket is on, and to open up when the jacket is off. I want to create a toggle for the jacket that also controls the blendshape of the shirt. 



To do this, 

  1. I’ll right click on the jacketOpen object,

  2. >create advanced toggle,

  3. Then in the new window that pops up, under animations I will click the plus button 

  4. and search for the name of the blendshape I want to change, in this case the blendshape is named Shirt.sleeveSqueeze, so I can simply search for “squeeze” and it will pop up.

  5. Then I will enable Generate Off Animation;

  6. When the blendshape is set to 100 the sleeve squeezes and when it’s set to 0 it opens, so in the animation I will keep it at 100 when the jacket is on and when the jacket is off I will change the blendshape value to 0.


This was just one example of the advanced toggle; you can create many more things with this tool, such as the ability to toggle completely different outfits consisting of multiple objects with one toggle button in your expressions menu!