Introduction to 2D Animation
This documentation contains information on how to quickly rig and animate a 2D character in Unity with the 2D Animation package and tools. The following package versions are only supported for the following Unity versions:
2D Animation package version 5.x.x - Unity 2020.2 or later
2D Animation package version 4.x.x - Unity 2020.1
2D Animation package version 3.x.x - Unity 2019.3
2D Animation and PSD Importer integration
You can use the 2D Animation package with the PSD Importer package to easily import your character artwork from Photoshop into Unity for animation. The PSD Importer is an Asset importer that supports the import of Adobe Photoshop .psb files into Unity and generating a Prefab made of Sprites based on the source file and its layers (see Adobe’s documentation on Layer basics).
The .psb file format has identical functions as the more common Adobe .psd format, with additional support for much larger image sizes. See the PSD Importer package documentation for more information about the importer’s features.
Adobe Photoshop PSB format
For character animation with the 2D Animation package, the PSD Importer package is required. The PSD Importer package currently only imports the Adobe Photoshop .psb format, and does not import the Adobe .psd format. The .psb format has identical functions as .psd, and is able to support larger image sizes.
Sprite Skin component
When the character Prefab is brought into the Scene view, Unity automatically adds the Sprite Skin component to any Sprite that has any bone influences. This component is required for the bones to deform the Sprite meshes in the Scene view.
Optional Performance Boost
When animating your characters, you can improve the runtime performance of the animated Sprite’s deformation by installing both the Burst and Collections packages from the Package Manager. This allows the 2D Animation package to use Burst compilation to speed up Unity’s processing of Sprite mesh deformation.
The Burst package is visible by default in the Package Manager, however the Collections package is not. To install the Collections package, follow these steps:
- Open the Package Manager.
- Press + at the upper-left corner of the Package Manager window to open a drop-down menu, then select Add package from git URL… from the list of options.
- In the Name box, enter “com.unity.collections”, then select Add.
After completing these steps, the Collections package is added to the Project.
The Sprite Skin component settings.
With both packages installed, Enable batching becomes available in the Sprite Skin component properties. Note that if you do not have the required packages installed, the option will not be visible.
The package has been tested with Burst version 1.4.1 and Collections version 0.9.0-preview.6. However if you encounter any bugs, you can turn the optional performance boost off by clearing the Enable batching option.