O'Reilly logo

Unity 5.x Animation Cookbook by Maciej Szcześnik

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

How to do it...

To play cutscenes during gameplay, follow these steps:

  1. Import your cutscene. Make sure to import the character animation as a separate file.
  2. Go to the cutscene asset's Import SettingsAnimation tab.
  3. Rename the Default Take animation to Cutscene.
  4. Create a new Animation Clip, choose the Default Take as the source, and set the Start frame to 0 and the End frame to 1. Call this animation CutsceneIdle and make it loop.
  5. Place the cutscene game object (in our example this is the Ball game object) and the character in the scene.
  6. Follow the Using root motion to steer a character recipe from Chapter 4Character Movement. This way, you will have a moving character you can control.
  7. Create an Animator Controller for the cutscene.

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