How it works...

stores vertices position of a mesh. We have to create them in a 3D package. Unity imports Blend Shapes and we can modify their weights in runtime using the SetBlendShapeWeight() function on the Skinned Mesh Renderer component. We can also use animations as shown in the, Animating facial expressions with Blend Shapes recipe in Chapter 5Characters Actions and Expressions.

Blend Shapes have trouble with storing Normals. If we import Normals from our model, it may look weird after morphing. Sometimes, setting the Normals option to Calculate in the Import Settings can helps with the problem. If we choose this option, Unity will calculate Normals based on the angle between faces of our model. This allowed us to morph a hard surface ...

Get Unity 5.x Animation Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.