This guide covers importing AutoSprite exports into Unity and setting up animated sprites.
Need to generate the asset first? Start with the Unity sprite sheet generator workflow, then use this guide for import settings, slicing, and clips.
Using Unity? Skip the manual setup. Our free AutoSprite Unity Extension auto-slices your spritesheet, builds animation clips with the right frame order and timing, and wires up the Animator Controller for all 4 directions â drop in your PNG + JSON and you're done. See the full extension guide for install steps and usage.
The manual instructions below are for everyone else (or anyone who wants to know what the extension is doing under the hood).
Quick Start
Install 2D Sprite Package
In Unity Editor, go to Window â Package Manager. Find 2D Sprite and install it if not already installed.
Import the Spritesheet
Drag your PNG spritesheet into your Unity project's Assets folder, or copy it directly into the Assets directory.
Configure Import Settings
Select the spritesheet in the Project window, then in the Inspector:
- Texture Type: Sprite (2D and UI)
- Sprite Mode: Multiple (required to slice into frames)
- Pixels Per Unit: Match your game scale (16, 32, 64, etc.)
- Filter Mode: Point (for pixel art) or Bilinear
- Compression: None (for best quality)
- Click Apply
Slice the Spritesheet
Click Sprite Editor button, then:
- Select Slice dropdown
- Set Type: Grid By Cell Size
- Enter your frame dimensions (from the JSON atlas
"w"and"h"values) - Click Slice, then Apply
Create Animations
- Select all frames for an animation in the Project window
- Drag them into the Scene view
- Unity automatically creates an Animation clip and Animator Controller
Detailed Setup
Import Settings Explained
| Setting | Recommended Value | Why |
|---|---|---|
| Texture Type | Sprite (2D and UI) | Enables sprite features |
| Sprite Mode | Multiple | Tells Unity this has multiple frames |
| Pixels Per Unit | 32 (or your game's scale) | Controls sprite size in-game |
| Filter Mode | Point | Keeps pixel art sharp |
| Compression | None | Preserves quality |
Using the Sprite Editor
- With spritesheet selected, click Sprite Editor button in Inspector
- Click the Slice button in the toolbar
- Choose Grid By Cell Size or Grid By Cell Count
- Enter dimensions from your JSON atlas:
- Look for
"w"and"h"values in frame data - Common sizes: 64x64, 128x128, 256x256
- Look for
- Click Slice to preview the cuts
- Adjust pivot point if needed (usually Center or Bottom)
- Click Apply to save
Creating Animation Clips
Method 1: Drag & Drop (Fastest)
- In Project window, expand your sliced spritesheet
- Select frames for one animation (e.g., idle_down_0, idle_down_1...)
- Drag into the Hierarchy or Scene view
- Unity creates both Animation clip and Animator Controller automatically
- Save the Animation clip when prompted
Method 2: Animation Window
- Select your sprite GameObject in the Hierarchy
- Open Window â Animation â Animation
- Click Create and name your clip
- Drag frames from Project into the timeline
- Adjust Samples (frame rate) - 12 fps for pixel art, 24 fps for smoother animation
Setting Up the Animator
Your Animator Controller needs states for each animation:
- Idle - Default state (Entry â Idle)
- Walk - Triggered by movement input
- Run - Triggered by run/sprint input
- Jump - Triggered by jump input
- Attack - Triggered by attack input
Use Parameters to control transitions:
Speed(float) - For walk/run blendingIsGrounded(bool) - For jump/fall statesAttack(trigger) - For attack animation
Code Example
Here's how to control animations in code:
using UnityEngine;
public class PlayerAnimation : MonoBehaviour
{
private Animator animator;
private SpriteRenderer spriteRenderer;
void Start()
{
animator = GetComponent<Animator>();
spriteRenderer = GetComponent<SpriteRenderer>();
}
void Update()
{
// Get input
float horizontal = Input.GetAxis("Horizontal");
float vertical = Input.GetAxis("Vertical");
float speed = new Vector2(horizontal, vertical).magnitude;
// Update animator
animator.SetFloat("Speed", speed);
// Handle facing direction
if (horizontal != 0)
{
spriteRenderer.flipX = horizontal < 0;
}
// Handle jump
if (Input.GetButtonDown("Jump"))
{
animator.SetTrigger("Jump");
}
// Handle attack
if (Input.GetButtonDown("Fire1"))
{
animator.SetTrigger("Attack");
}
}
}
Tips for Unity
For pixel art games, always set Filter Mode to Point and Compression to None. This keeps your sprites crisp at any scale.
Common Issues
Sprites look blurry:
- Set Filter Mode to Point (no filter)
- Set Compression to None
- Make sure you clicked Apply after changing settings
Animation plays too fast/slow:
- Select the Animation clip in Project window
- Adjust Samples value (frame rate)
- 12 fps is good for pixel art, 24 fps for smoother animation
Pivot point is wrong:
- Open Sprite Editor
- Select individual frames
- Change Pivot dropdown or drag the pivot point
- Click Apply
Sprite Mode not showing Multiple option:
- Make sure 2D Sprite package is installed
- Check Texture Type is set to Sprite (2D and UI)
