VRChat Wikia
Advertisement

This will enable you to trigger custom animations by on any avatar.

Getting Started[]

  • First let's prepare a couple of things in Unity 5
    • Make a folder for your avatar and include the animation files
    • In the asset folder make a duplicate of the "SampleAvatarController" found in to VRCSDK2>Sample Assets, rename it and move it to your avatar folder
    • If the animation you have imported is an fbx, first you will need to make that fbx a "humanoid" in the "rig" tab then collapse it and extract the animation file using Ctrl-D. Also don't forget to make sure your avatar is set to humanoid.
    • Double-Click your renamed AvatarController and select the animation layer under the "Layers" tab

Replacing Standard Walking Animations[]

  • Double Click on the blend tree and in the inspector you will replace your walking animations in the inspector. You will need Idle, Walking forward, right, left. You can place the walking forward animation in the same slot for walking backward as it will just play the animation in reverse. You do this you can skip down to the last step below

Inserting New Animation on Key Press and Hold[]

  • Select the Parameter tab next to the Layers Tab in the Animator. Select the "+", select bool and put the name you wish to toggle the animation.
  • Drag the animation you desire into an empty area in the animation layer
  • Create transition from the blend tree to your animation by right clicking and selecting "make transition"
  • Select the connecting arrow line and add a condition by selecting the "+" under conditions and the select your created parameter name on the left dropdown list and "true" on the right.
  • Now create a transition from your animation to the blend tree and repeat step iv except the right condition choice should say "false"
  • In inspector you should have the settings listed below:

Animator Inspector Settings for Key Press Animation[]

  • Here are the settings you should have when in the inspector window when the transition arrows are selected in the Animator
    • Settings for arrow transition from Blend Tree to Your Animation
BlendAnimTrans Settings Key Press
    • Settings for arrow transition from Your Animation to the Blend Tree
AnimBlendTrans Settings Key Press

Animator Inspector Settings for Key Hold Animation[]

  • Here are the settings you should have when in the inspector window when the transition arrows are selected in the Animator
    • Settings for arrow transition from Blend Tree to Your Animation
Settings for Animation Key Hold Enter
    • Settings for arrow transition from Your Animation to the Blend Tree
Settings for Animation Key Hold Exit

Unity Inspector Settings for Key Hold & Press[]

  • Now we will discuss the inspector settings in the scene
    • You will need 2 components when making your animation work VRC_Event Handler, VRC_Key Events
    • Your component settings should look like this:
Capture
  • In the inspector under animator, insert your newly constructed avatar controller
Advertisement