How it works...

The main feature of this recipe is hiding the character's head. To do so, we simply need to scale the head bone to 0. All vertices assigned to this bone will be then squashed to the same point in space. After we hide the head, we can spawn a second one with a Rigidbody component and a Collider attached. This way our second head will fall down. To make the effect more spectacular, we're adding a small random force and torque to the newly spawned head. This makes it rotate and fly up after the decapitation.

We also spawn a neck game object to mask the stretched polygons that appear after we scale the head to 0. We use the HeadMarker and NeckMarker game objects parented to the corresponding bones in the character's rig just because they make it easier to match the position and rotation of the Head and Neck objects.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.188.137.37