Basic Hand Animations

Bryson Teruya
4 min readNov 3, 2023

--

Now that we have working hand models to represent each controller in VR, let’s take a look at animating them!

If you are familiar with developing in Unity, you may have worked with the Animator Controller component here:

What this component does is it creates a flow chart of instructions to play/stop certain animations given certain circumstances! We will use this component today to create a simple grip animation that plays when we hit the select button and stops when released.

To start, create two Animator Controllers for each of the hands.

Drag each respective controller into the Controller Slot for each Hand Prefab.

If you double click on the hand prefab, you can view the list of game objects that comprise the “skeleton” of the prefab itself. Animations will move certain objects of the skeleton at certain intervals in a timeline!

Now we need animations to play with the controllers that have been set up. I’ve found mine off of Filebase, or you can create your own via software like Blender or Maya. You can then preview if the animation is compatible by clicking on the animation clip, and dragging the prefab you want to use for it into the preview scene.

If the animation doesn’t display correctly, this can be because when the animation has been imported into Unity the File names have been adjusted making them incompatible. To fix this, off of Filebase there is a downloadable script tool called Underscore replace which will fix the adjustments back to the proper names.

When installed, select the prefab which needs to be renamed and navigate to tools → Underscore replace and then click Rename on the tool window.

Once completed, you should now see the correct animation state in the preview window.

Next we need to set up the logic in the controllers.

Create two empty states, one for open and the other for closed. Make two transitions back and forth between the two new states. This will create the functionality of pressing a certain button to play the grip animation, and when released it reverts back to its default state.

In the Open state, I’ve slotted in the default animation and the closed state I’ve put the “fist” animation. In each of the transitions, deselect Has Exit Time as this will lead to improper looping between the animations.

Lastly we need to create two trigger parameters that resemble press/unpress the Select Button.

These then need to be set in each transition appropriately.

Select button is pressed:

Select button is released:

Repeat these steps for the other hand’s controller, but make sure to slot in the correct animations for the respective hand the controller is assigned to.

If we test this, we can now “grab” with each hand by pressing/unpressing the Select button!

--

--

Bryson Teruya

Highly motivated and disciplined individual with a passion for building games and interactive experiences using Unity & C#.