Skip to playerSkip to main content
How to import 2d animation into unity (Step by Step)
#how #to #import #2d #animation #into #unity
Transcript
00:00To import and set up 2D animation in Unity, you need to install the required packages,
00:04import your artwork either as a sprite sheet or a layered PSB-PSD file, slice the sprites,
00:10and use the animation and animator windows to play them.
00:13Step 1. Install the 2D animation packages open Unity and go to Window, then Package Manager.
00:19Set the package's source to Unity Registry. Search for and install 2D animation.
00:242D sprite, usually built in by default.
00:26Step 2. Import your artwork file.
00:29Depending on how your artwork is structured, choose one of two common methods.
00:32Method A, Sprite Sheet, PNG Sequence, or Grid Sheet.
00:36Drag and drop your image file, PNGJBG, into your Unity Assets folder.
00:41Select the image in the Project window.
00:42In the Inspector window, set Texture Type to Sprite 2D and UI.
00:47Set Sprite Mode to Multiple if it contains multiple frames.
00:50Set Filter Mode to Point No Filter if it is Pixlr.
00:53Click Apply.
00:54Click the Sprite Editor button in the Inspector.
00:55Click Slice at the top left.
00:57Choose Grid by Cell Size or Cell Count.
00:59Type in your frame dimensions or counts and click Slice, then Apply.
01:03Method B, Layered Photoshop.PSB File.
01:06Save your artwork as a .tsb file.
01:08Photoshop Large Document Format.
01:10Drop the .tsb file straight into your Unity Assets folder.
01:13In the Inspector, enable Character Rig and use layer grouping to preserve your limb layers.
01:19Here's the Skinning Editor.
01:20Accessible via the Sprite Editor to add bones and paint weights if you are doing skeletal 2D animation.
01:26Step 3.
01:27Create the Animation Clip.
01:29Expand your sprite in the Project window so you can see all the individual frame slices.
01:33Select all the frames of the specific animation, for example, all run cycle frames.
01:37Drag and drop them directly into your Scene Viewer hierarchy.
01:41Unity will prompt you to save a new .anim file and an Animator Controller.
01:44Name your animation clip, for example, PlayerRun.anim.
01:47Open the Animation window.
01:49Window, then Animation, then Animation.
01:51To adjust the speed, change the samples, frames per second at the top left, for example,
01:56set it to 12 or 60 depending on how fast you want the frames to cycle.
02:01Click Play in the Animation window to preview your sequence.
02:04Step 4.
02:05Set up the Animator Controller.
02:06Locate the .controller file generated in your project, for example, Player.Controller.
02:10Open the Animator window.
02:11Window, then Animation, then Animator.
02:14Drag additional animation clips, like Idle or Jump, into the Animator Graph if you have them.
02:19Right-click an entry state, like Idle.
02:21Click Make Transition, and link it to your new animation to control how and when the character
02:26switches animations via parameters, for example, bool or trigger for is running.
02:31And that's the full picture.
02:32If this saved you a search, hit like and subscribe.
02:35One clear answer every day.
02:37See you in the next one.

Recommended