Game Development Reference
In-Depth Information
the ramping parameters for the animations. Go back to RAIN's
Animation
tab and
set the
Fade Out Time
field of the run animation to
2
. Now, if you run the anima-
tion, Penelope will start to transition out of the running state for two seconds, and al-
though everything doesn't look perfect, the transition is much smoother than before.
Feel free to play with other ramp settings to get a better effect.
This shows how RAIN works with Unity's legacy animation system; now, let's look at
Mecanim.
RAIN and the Mecanim demo
Mecanim is Unity's latest animation system that's able to play animations on arbitrary
characters. We won't go into detail on how Mecanim works and instead focus just on
RAIN's usage.
For this demo, we will use a character already set up for Mecanim from Unity's
sample.Ifyouhaven'talreadydoneso,downloadandimportUnity'sMecanimdemo,
Mecanim Example Scenes v1.0
, which is free on the Asset Store. Add the teddy
bear character from
Character/Teddy2/TeddyBar.fbx
to your scene. Then, in
the
Animator
component for Teddy, set the
Controller
field to
IdleRunJump
from
Controllers
. Then, add a RAIN AIRig to Teddy by going to
RAIN
|
Create AI
. We'll
have Teddy walk on a different route, so create a new waypoint patrol route and
name it
TeddyRoute
. Your scene should look like this: