Making VRoid Characters Blink in Unity

By default, characters loaded into Unity using UniVRM do not blink. You can animate blinking yourself using animation clips, but UniVRM also provides a script to help. The script only kicks in when playing the game (it is not visible when editing and scrubbing through the timeline).

The script is located in the UniVRM directory of the project’s assets.

blink-1

There are a few different scripts in this directory. We are interested in the Blinker script.

blink-2

To add this script to your VRoid character, simply drag the script to the area under the existing components in the Inspector panel for your character (where the Add Component button is). This will add a new component and set defaults for property values. (It goes on the root object, not the nested Face object.)

blink-3

The properties control the time in seconds between blinks, how long it takes to close the eyes, how long to keep the eyes closed, and how long to reopen them. This script inserts a bit of randomness in duration as well, which is more like real life.

The Blinker script has a reference to the VRMBlendShapeProxy component also on the root character component. This component provides sliders for the various facial expressions, which is a good way to animate character expressions.

blink-4

It is called a proxy as the real blendshapes are on the child Face object. The proxy however uses friendly names for the expressions and only provides access to the main overall facial expressions.

The biggest issue I have had with auto-blinking is sometimes the blendshape to close the eyes is too strong. By editing the Blendshape.Blink definition to reduce the strength a bit the closed eyes look a little more natural.

For example, here is the eyes open for one of my VRoid characters.

blink-5

At 80% closed, this looks reasonable.

blink-6

But at 100%, the eye lashes are disappearing into the face.

blink-7

The Blinker script uses Blendshape.Blink (via the proxy) to make the eyes blink. To change the default strength, find the appropriate asset directory.

blink-8

Double click on the BlendShape.Blink file.

blink-9

This will bring up the inspector panel. Adjust the Face.M_F00_000_00_Fcl_EYE_Close value to 80 (down from 100).

blink-10

Then when you start the game in Play mode, the character will start blinking automatically at 80% strength!

If you do not want to use the Blinker script, there are Unity articles that create an additional Animator Layer that plays the eye blink animation clip in a loop. By putting as a higher level priority than other layers, it will take over the part it animates (the eyes). This clip can then be played continuously in a loop. No components need to be added in this model.

I hope you found this blog post useful. For a full list of blog posts on Unity and VRoid for movie creation, see here.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s