Creating a Transition
We'll create a toggle that runs the 'explode' animation using transition states.
A tutorial video is available for this guide:
Otherwise follow along with the documentaion:
First make sure you have VRCFury installed in your project.
Next, create a new object on your avatar and give it a name. Note that you can have multiple toggles on the same object, so this object is just here for organization.
Select this new object, click Add Component
in the Inspector
tab and find Toggle (VRCFury)
Next, name your toggle. This can be anything, including /
to create sub-menus. I'll name it Voxel/Explode
which will create a Explode
toggle in the Voxel
folder on my avatar's radial menu.
We'll want to click on Options
and select Enable Transition State
.
We'll be making the avatar explode, so we'll want the explode parameter to go from 0 to 1.
If your explode parameter is 0 by default, you don't have to add an action to the Transition In
slot. Otherwise you'll want to add a Material Property
action there that sets the explode parameter value to 0.
You will need to add a Material Property
action to the Then do this until turned off
Add Action
button.
We'll set it to Apply to all Renderers
which will change that specific material property on all renderers on your avatar. You might not always want this and if you don't you'll have to specify the renderer (skinned mesh renderer or mesh renderer) that you want the material property value to change on. Beware that material property changes on renderers will change the property on all materials of that renderer! More information about how to work around that can be found in the animated property documentation, specifically the renamed properties part.
Now all we have to do is specify the material property name and the value we want to swap it to.
We need to find the material property, set it to animated and copy its property name. Both of these can be done by finding your property in the material editor, right-clicking, and 1) click Set Animated
and Copy Property Name
. We can then put the property name into the Property
slot of the VRCFury material property toggle we just created.
Now set the value that the property will transition to in the VRCFury toggle. For our explode toggle we'll set it to 1.
And then we can configure the speed that it transitions to by setting the Then blend for this much time
field. I'll set it to 1.5.
You can make the animation reverse by setting the Then blend for this much time
field at the bottom (there's 2 of them, pick the bottom most one) to a speed that isn't 0. In our case this will make the explode happen in reverse.
That's about it. You can use Gesture Manager or create a build & test version of your avatar to test this out in game now.