O'Reilly logo

Unity 4.x Cookbook by Matt Smith, Chico Queiroz

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Applying ragdoll physics to a character

Action games often make use of ragdoll physics to simulate the character's body reaction to being unconsciously under the effect of a hit or explosion. In this recipe, we will learn how to set up and activate ragdoll physics for our character whenever he steps on a landmine object. We will also use this opportunity to reset the character's position and animations a number of seconds after that event.

Getting ready

For this recipe, we have prepared a project named MixamoProject containing several assets such as levels, animated characters, and props. You can find it inside the 0423_05_codes folder.

How to do it...

To apply ragdoll physics to your character, follow these steps:

  1. Open the MixamoProject project, and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required