Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Unity 5.x Animation Cookbook

You're reading from   Unity 5.x Animation Cookbook An advanced solution to all your Animation problems

Arrow left icon
Product type Paperback
Published in May 2016
Publisher Packt
ISBN-13 9781785883910
Length 328 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Maciej Szczesnik Maciej Szczesnik
Author Profile Icon Maciej Szczesnik
Maciej Szczesnik
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. Working with Animations FREE CHAPTER 2. Working with the Animation View 3. 2D and User Interface Animation 4. Character Movement 5. Character Actions and Expressions 6. Handling Combat 7. Special Effects 8. Animating Cutscenes 9. Physics and Animations 10. Miscellaneous

Importing object animation from a 3D package

In Unity, you can import not only skeletal animation but also object transform animation. It can be useful for creating complex movements, for instance, an object following a path.

Getting ready

You have to animate an object's translation, rotation, or scale in a 3D package, then export the object as FBX file. You can also download the provided example Unity project and go to the Chapter 01 Working with animations\Recipe 10 Importing object animation from a 3D package directory. There is a scene called Example.unity there. This object has a follow path animation created in Blender and exported to FBX file. It has a normal Animator Controller with that animation as default state (looped). You can run the game to see the object animate.

How to do it...

To import object animation, follow these steps:

  1. Animate an object in a 3D package (translation, rotation, and scale animations are supported).
  2. Import the object into Unity and select the Generic rig type.
  3. You can adjust animation settings normally (loop an animation for instance).
  4. Create an Animator Controller and drag and drop one of the imported animations into the Animator window to create a default animation state.
  5. Place your animated object into a scene and assign the controller to the Animator component of the object.
  6. If you run the game, the object will be animated.

How it works...

Unity imports translation, rotation, and scale animation of 3D objects from a 3D package. It makes it easy to create complex animations and use advanced features of a chosen 3D software. Make sure to bake your animations into frames before importing them to Unity (Blender bakes the exported animations to frames by default). Importing mesh animation (vertices movement) is not supported (you have to use Blend Shapes instead; we will discuss them in detail in the Animating facial expressions with Blend Shapes recipe in Chapter 5Character Actions and Expressions).

You have been reading a chapter from
Unity 5.x Animation Cookbook
Published in: May 2016
Publisher: Packt
ISBN-13: 9781785883910
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime