2D in Unity: Tech Art Essentials
Set up a Unity 2D project with URP, prepare art at the right resolution, and master sprite sorting, cameras, and Cinemachine.
This article is for developers and artists with intermediate Unity experience who want to make a commercial 2D game, whether they work independently or with a team.
How to open a new 2D project
Use these install steps to follow along with this article:
1. Install the latest version of Unity 6 from the Unity Hub. At the time of writing, Unity 6.3 is the latest official release.
2. In the Hub, create a new project with the Universal 2D template; this is the template that uses the Universal Render Pipeline (URP). In any version of Unity from 2021 and later, the 2D Renderer is already configured to work with URP.
A number of packages are included in the 2D template:
- 2D Animation: For implementing native skeletal animation at runtime
- 2D Aseprite Importer: Enables the import of .aseprite files from the pixel art creation tool Aseprite
- 2D Common: Contains the code used by several 2D packages
- 2D Pixel Perfect: Provides a camera component to ensure crisp pixel art at different resolution and ratios, with features like snapping, upscale rotations, etc.
- 2D PSD Importer: Provides support for layered .psd and .psb files, convenient for multisprite character animation
- 2D Sprite: The Sprite Editor window used to configure sprite properties.
- 2D SpriteShape: For creating sprite tiling along a shape’s outline that automatically deforms and swaps sprites based on the angle of the outline
- 2D Tilemap Editor: For creating and editing tilemaps to populate large grid-based worlds
- 2D Tilemap Extras: Contains extra scripts for use with 2D Tilemap, like custom tiles and brushes
The Universal 2D template comes with several project settings that are optimized for a 2D game:
- The images are imported as sprites and set to Sprite mode.
- The Scene view is set to 2D.
- The default scene includes a Global Light 2D.
- The default Sprite Renderer material is Sprites-Lit-Default.
- The camera’s default position is at 0, 0, –10.
- The camera is set to Orthographic.
- In the Lighting window settings:
- All Global Illumination is disabled.
- Skybox material is set to none.
- Ambient Source is set to Color.
URP for 2D games
URP is Unity’s default renderer for 2D and 3D games. It’s the successor to Unity’s Built-In Render Pipeline, and is designed to be efficient for you to learn, customize, and scale to all Unity-supported platforms. In the Unity 6.x cycle, it offers the same functionality as the Built-In Render Pipeline, and in a number of areas, exceeds its quality levels and performance.
URP provides a graphics pipeline for 2D Lighting, allowing you to create 2D lights and lighting effects. It integrates with 2D renderers, such as the Sprite Renderer, Tilemap Renderer, and Sprite Shape Renderer, as well as 3D renderers like MeshRenderer or SkinnedMeshRenderer. It’s also compatible with Shader Graph, VFX Graph, post-processing effects, and camera stacking.
URP settings
URP base configurations are available in two assets in your project:
- The Universal Render Pipeline Asset provides settings for quality, lighting (3D), shadows (3D), and post-processing.
If you want to have different settings for different hardware, you can configure Quality settings across multiple URP assets and switch them out as needed. The URP Asset is linked to the Renderer Data Asset via the Renderer List. When you create a new URP Asset it will have a Renderer List containing a single item, the Renderer Data Asset created at the same time, set as the default. You can add alternative Renderer Data Assets to this list.
- A Renderer Data Asset that you can use to filter the layers the renderer works on, and intercept the rendering pipeline to customize how the scene is rendered. It controls high-level rendering logic and passes for URP. It supports Forward and Deferred paths, and the 2D Renderer that enables features such as 2D lights, shadows, and light blend styles. You can even extend URP to create your own renderers.
This article does not cover all of the technical and visual possibilities with URP. To understand the full capabilities of URP, download the e-books from the resources section.
2D Renderer settings
Here’s an overview of the 2D Renderer settings in Unity 6.3; please see the documentation for further details.
- Layer Mask: The layers that you plan to render, by default it should be set to All
- Transparency sort mode: Will sort sprites based on the camera type that you use
- Default Material Type: Useful to define what material to add to any new 2D object, Lit if you use 2D lights, Unlit if not, or custom for your own material
- Depth/Stencil Buffer: Enabled by default, you can use depth effects if you make use of z-depth and perspective
- HDR Emulation Scale: Scale used to remap when using dynamic range
- Light Render textures: Scale and limits when creating 2D light textures; lower the values to increase performance when using 2D lights
- Light Blend Modes: Four possible blend styles to use on 2D lights; Add, multiply, subtract RGB values and affect only mask map channels
- Camera Sorting Layer Texture: Enables access in Shader Graph to the image created by the 2D renderer to apply effects to it, like a water reflection
- Post-Processing: To add effects to the frame once processed
Preparing 2D art and assets
During the art concept phase, you’ll need to make many decisions that will impact the technical side of your project.
In game design, it’s common practice to mock up a screenshot or series of images to show the game’s art style, action, and UI. Mockups are a quick way to determine if the concept is viable and get a sense of how the final game would look.
You can also explore multiple art directions with simple thumbnail mockups. These mockups would have simplified shapes and focus more on the overall look, camera angle, object sizes, color palette, and contrast. Using thumbnails is a great way to present different approaches to the team for testing and iteration.
A few things to consider when making a mockup:
- What will be the camera angle and perspective of your game?
- What will be the size of the player character in relation to the screen size of your target platform?
- Does your art style fit the target platform, theme, and audience? For example, will this style appeal to casual gamers, young players, strategy fans, and so on?
- How does the art style fit with the overall graphics approach?
- If the gameplay requires fast reaction times, then it’s a good idea to make elements such as the player character, enemies, and projectiles visible against the background at first glance.
- Mobile games should be brighter and have higher contrast to be visible in the sunlight and smaller screens.
- What are the size, position, and visibility of UI elements?
Technical considerations
There are also important technical questions to consider in the mockup stage. These include:
- Animation: What elements will you animate with skeletal animation? Which ones will have frame-by-frame animation or be animated with a shader
- Environment: Will you create it with a tilemap or sprite shapes? Or, do you want to place platform sprites in the scene manually? You can paint your mockup to mimic the look of these tools so that you can use the mockups directly in your game.
- Sorting: Plan your sprite sorting by grouping mockup layers similarly to how you anticipate the sorting will be done in Unity. It might take some time, but you’ll avoid having to sort through potentially thousands of sprites later in production.
- Lighting: Will your sprites be lit with lighting and shadows painted onto them or with real-time lighting? One tip is to paint images with no lighting, then add shadows and lights on separate layers in your image-editing software. That way, you can always change the look of the lighting later in production if necessary.
Take the time in this stage to create assets that are as close as possible to what they will look like in the final game. This allows you to move from concept to game production more quickly.
Resolution of your assets
Unity’s 2D tools evolved from an editor built initially for 3D games. As a result, there are some unique features. For example, 2D sprites in the Scene view aren’t bound tightly to screen resolution. Sprites in Unity are textures drawn onto a mesh and are easily scalable. The camera in 2D games is also scalable and can zoom in and out as you want.
Therefore, creating 2D content in Unity requires a different approach to that of working in traditional raster graphics software such as Adobe Photoshop, Affinity Photo by Serif, GIMP, or Krita. In these conventional apps, you have a specific document canvas size available with a set resolution, and all layers are bound to this resolution. There is a 1:1 ratio between the pixel size of each layer and the document pixel size.
When drawing game assets, the pixel size is consistent, and the image looks great because it’s always constrained to the pixel grid. However, in Unity, the sprites can have a different resolution. The camera zoom level will also affect the final look.
In Unity, however, screen and asset resolution are independent of each other, so you need to calculate the resolution of your sprites.
You start with your target platforms because the capabilities of the hardware determine the maximum resolution you can set.
For mobile devices, the resolution range is broad, but a safe assumption is 1920x1080, since this will allow you to target devices from low- to high-end.
For PCs, the majority of desktop gamers use full HD (1920x1080), according to a survey from Steam. You might also want to consider supporting ultra-wide screens, making sure you test screen ratios like 21:9 to ensure the camera won’t display unwanted areas of your level.
To target full HD or 4K, keep a couple of best practices in mind (these rules don’t apply to pixel art):
- Paint art in the highest resolution for your target devices. Don’t scale up raster art because it can result in pixelation and blurriness.
- Stick to one resolution for all assets, and scale down later if necessary to support lowerend devices.
One helpful trick is drawing your art at twice the size you need, then scaling it to 50% when you export to Unity. This technique will make your sprites look polished and crisp, and brush lines won’t look so shaky. Don’t overdo it on the details, since the art will be scaled down. This is a good trick for hiding the small imperfections resulting from hand-drawn art. Of course, if you want a hand-drawn visual style for your game, then don’t try this.
Once you’ve chosen the resolution, test the look of your art in the Game view to see how it will appear on target devices.
You can easily preview how the game looks at different ratios and resolutions in Game and Simulator view in the Editor.
To keep it simple, calculate sprite resolution in orthographic view instead of perspective. Set their scale to 1,1,1 and Z depth to 0 for easy visualization.
Use the Unity grid and units to maintain consistent placement and appearance of your sprites, as well as to calculate camera zoom and object sizes.
A Unity unit is visualized by the grid in the Scene view. Assume that 1 Unity unit is equal to 1 meter. Set your base sizes first, and keep them consistent across your game.
Start with the size of your player character. Keep the height of the player character between 0.5 and 2 units. If you’re using Tilemap, set the tile size to 1 unit.
Characters and objects that are too small or large compared to other visual elements in a game will lead to strange transform numbers and issues with physics calculations.
Once you’ve established the sizes of your base objects in the main scene (Player character, enemies, collectibles, level hazards), choose your zoom level by setting the size property of the orthographic camera. After that, check the camera size value. When you multiply this value by 2, you’ll get the camera vertical size in Unity units.
Determine early on how much gameplay area will be displayed on the screen, e.g., if you’re developing a tight platformer, you’ll want to lock this early on for game design and art preparation purposes.
The size of the orthographic camera is expressed in units that denote the vertical size of the camera from the center to the top.
If the camera size equals 5, it means that it’s displaying 5 units from the center of the screen to the top, with a total height then equal to 10 units. For example, if you target 4K resolution, then the screen (or camera) height is 2160 pixels. With a simple calculation, you can determine how many pixels per unit (PPU) your art needs:
2160 : 10 = 216
Max vertical resolution : (orthographic camera size *2) = sprites PPU
So every sprite in your game needs to have around 216 PPU to look good at a native 4K resolution.
That’s a simple example. If you want your camera to zoom in and out, you’ll need to account for that. If you set the maximum zoom percentage to size 3 in Orthographic view, the PPU needs to be 360 (2160 : (3 *2)).
If you use skeletal animation, set the resolution of sprites slightly higher than the suggested PPU. This is necessary because the meshes of the skeleton are rotated, stretched, and warped, sometimes to extremes, which can produce odd or poor-looking results.
Test your game on devices to check how it looks. In many cases, the benefits of using highresolution assets aren’t apparent. Instead, you can allocate this drawing time and device memory to other, more essential, game elements like the main characters, visual effects, or UI.
On mobile devices, game size is crucial, so check which assets can be scaled down and keep memory limitations in mind. Read more about 2D asset resolution in this blog post.
Get Photoshop PSD files into Unity
Exporting to PNG file format is the most common workflow for sprites, but you can also import PSD files directly into Unity. By default, Unity will flatten the PSD layers into one image if you don’t have the 2D PSD Importer package installed, which is the case if you start your project from the 2D template.
Unity’s 2D PSD Importer package gives you the option of importing layers as separate sprites. This package was designed for use with 2D animation, but you can use it to import multiple regular sprites contained in one PSD file.
The PSD layers can have different blend modes, opacities, effects, or be smart objects that will display correctly in Unity.
The PSD workflow is very convenient to use for your game sprites or UI elements. You can edit, paint, or create new layers, and when you save the file, the changes will be instantly visible in the Editor. With your PSD source file directly in the Unity project, the file can be included in source control of the project like Unity Version Control.
The PSD prop imported with its layers ready to use in Unity without intermediate standalone PNG files
Draw order
In a 2D game, all sprites and objects have the same depth. How can you sort them so that some appear in front of others?
Unity sorts Renderers according to a priority order that depends on their types and usages. You can specify the render order of Renderers using their Render Queue. In general, there are two main queues: the Opaque queue and the Transparent queue. 2D Renderers are mainly within the Transparent queue and include the Sprite Renderer, Tilemap Renderer, and Sprite Shape Renderer types.
2D Renderers within the Transparent Queue generally follow a priority order. When two or more objects occupy the same space, Unity goes through this list and checks which object should be drawn on top. When there’s a tie, and both objects have the same value, the next criteria on the list is evaluated:
- Distance to camera or custom axis
- Order in Layer
- Sorting Layer
- Sorting Group
- Specify Render Queue
- Material / Shader
When all of the above values are the same for both objects and a tiebreaker is needed, this process must choose which one to render on top. It’s not an ideal solution, so make sure to set a distinct sorting order using Sorting Layers and Sorting Groups.
Sorting Layers
The most important sorting criteria are Sorting Layers. All 2D Renderers have this option, and it’s the first thing you need to set up. There is a default sorting layer which you can edit by opening Project Settings, then specifying Tags and Layers options.
Add, delete, or change the order by dragging the handle on the left of the Layers. Layers that are higher on the list are rendered first and will appear further away from the camera.
Plan the Sorting Layers structure, even when designing a mockup to organize your scene early on. Set a sprite’s sorting group as soon as you place it in the scene. These practices will help you to avoid a situation later in your project development when you suddenly realize you have to change sorting settings on potentially thousands of sprites.
Avoid too many Sorting Layers
2D Lights rely on Sorting Layers, so consider lighting when you set the Sorting Layers structure. Know beforehand how you want the lights to behave in your game and what groups will be affected by them.
For example, if you’re making an isometric game and plan to have torches that use 2D Lights, will the torches affect their entire surroundings or only the walls? Will characters be affected, or will they be drawn in front of the light? Will you need a Sorting Layer just for the objects that will receive light? Keep these kinds of questions in mind when you’re editing Sorting Layers, and learn more about planning lighting in the 2D Lights section.
Be wary of using too many Sorting Layers, which can cause you to lose oversight of all the details. When you need to sort renderers further, use Order in Layer. This allows you to sort objects that are on the same layer easily.
Transparency Sort Mode
If you use an orthographic camera you might want a fake 3D view in your game, such as an axonometric or oblique projection for an isometric top-down game with a bit of an angle, or a cabinet projection in brawler games. If so, you’ll need to custom sort the renderers by Distance to Camera.
Choose a custom axis to sort objects. In the case of a top-down game or brawler, sort objects on the Y axis, so higher characters will be rendered below other characters, giving the illusion that they are further away. To edit this option, find the 2D Renderer Asset created when setting up the URP, and change its Transparency Sort Mode option to Custom Axis, then set its Transparency Sort Axis value to 0, 1, 0.
Sorting sprites on the Y axis, the value (X:0, Y:1) 1 tells Unity to follow a downward vector (as in Vector2.down) for the sorting criteria. The sprites at the top will be drawn first, and the ones at the bottom later, making them visible at the front.
You can represent any vector with sort axis that will be the direction in which sprites will be rendered from top to bottom.
Sorting Groups
Even if you follow the previous steps and sort on the Y axis, the appearance of your character’s parts or child objects might still display incorrectly.
Parts of the characters that are on the same Sorting Layer are mixed between two characters.
It’s not a bug. This is just how sorting works. Sorting doesn’t know which parts belong to which character if they are on the same Sorting Layer. Fortunately, Sorting Group is the fourth criteria on the sorting priority list.
Sorting Group is a component that groups Renderers that share a common root for sorting purposes. All Renderers within the same Sorting Group share the same Sorting Layer, Order in Layer, and Distance to Camera.
When using characters or other objects that consist of a couple of sprites, put this component on its Parent object (highest in the hierarchy), and set Sorting Layer and Order in Layer just like on any other 2D Renderer. You can see an example of this in this Unite Now technical session.
Creating a Sorting Group in the parent GameObject to ensure that this object and its child objects get sorted as a single element, avoiding potential conflicts between its parts and other sprites in the game
The Sorting Group makes the characters appear as they should.
You can also nest Sorting Groups. If you have weapons consisting of multiple sprites that you want to be generated randomly, put them in Sorting Groups to make them display correctly in characters’ hands.
Cameras and perspective in 2D
Orthographic or perspective camera
For most 2D games, you’ll want to set your camera to Orthographic mode. It’s the default choice for 2D projects because lines of one dimension are parallel, and you work only in two dimensions. The orthographic mode works for all styles – pixel art games, puzzles, 2D isometric, top-down, platformers.
Although 2D games have no real depth, the illusion of depth can be created using the parallax effect. The parallax effect scrolls multiple layers in the background and foreground at different speeds when the camera moves. The intent is to mimic human depth perception, wherein objects farther away appear to move more slowly than those closer to us.
Perspective camera setup in Tails of Iron By Oddbug Studio; learn how they created the lighting in their game with Unity 2D Lights
If orthographic mode is suitable for all 2D game styles, why even use perspective mode?
One reason is that this offers access to parallax effects out of the box; as the name suggests, a perspective camera uses a perspective viewpoint. You don’t need to use scripts to handle the scrolling of parallax layers. Instead, you position elements further from the camera on the Z axis and scale them up to account for perspective based on their relative distance from the camera.
The camera you choose doesn’t impact the art creation process, but it does determine how the levels are set up and the look and feel of the game.
To sum up, orthographic mode is likely the most common choice, except when you’re using advanced scrolling and parallax. In that case, you probably want to go with perspective mode.
Camera stacking
Camera stacking in URP allows you to layer camera outputs and combine them in one final image. You can combine 2D, 3D, and UI objects with camera stacking.
A use case for camera stacking can be to display other areas of the map on top of the main camera, for example, to enable a second player to explore other parts of the map, like a split screen, or in this case, to provide an aerial view of the scene.
At least two cameras are required in the scene for stacking. Choose which one will be the base camera for the image you want to be rendered first, and any additional cameras need to be set to Overlay.
The base camera needs to know which cameras overlay on top and in what order. To do that, go to the Stack option, and select a camera to overlay with the + button. Change the rendering order of Overlay Cameras as needed by dragging them up or down in the list.
Use layers to set which objects are rendered by each of the cameras. By default, cameras render every layer, but you can change that by selecting which layers are rendered by the camera in the Culling Mask option on a Camera component.
Now, select the GameObjects you want the camera to render, and change their layer to match the one set earlier. That way, objects are categorized to be rendered by different cameras, such as a 3D background and 2D platform layers.
Cinemachine for 2D
Once you’ve selected the camera type, you’ll need to set it up to follow the gameplay. Unity’s Cinemachine system provides the functionality to do this and much more, such as confining the camera to level bounds, setting up camera transitions, noise, and so on. This section highlights some of the core Cinemachine functionality for 2D games.
To get started, install Cinemachine from the Package Manager. Then complete the following steps to add a Cinemachine camera to the Scene view in your project:
- In the Scene view, navigate the Scene to get the point of view you want to frame with the Cinemachine Camera.
- In the Unity menu, select GameObject > Cinemachine > Cinemachine Camera. Unity adds a new GameObject with:
- A Cinemachine Camera component and
- A Transform that matches the latest position and orientation of the Scene view camera.
When you create the first Cinemachine Camera in a scene, Unity automatically adds a Cinemachine Brain component to the Unity Camera, unless the Unity Camera already includes one. To verify it:
- In the Hierarchy, select your Unity Camera (this is the GameObject that includes the Camera component).
- In the Inspector, verify that the GameObject includes a Cinemachine Brain component.
The Cinemachine Brain monitors all active virtual cameras in the scene. Animate the virtual cameras with keyframes, blend or smoothly transition between the cameras, or create a combination of the two to animate one camera while transitioning to another. All of the animation will be processed by the Cinemachine Brain and applied to the main camera – think of it as a powerful animation system that drives your main camera.
To create a 2D virtual camera, click on Cinemachine > Create 2D Camera. This will create a virtual camera set up for a 2D environment. If it’s your first Virtual Camera in the scene, it will also add a Cinemachine Brain Component to your main camera.
Cinemachine needs an object to follow, so assign a player character in the Tracking Target field. To ensure that you are operating on a 2D plane and that the camera isn’t panning or tilting, check that the Look At Target field is empty and Position Control is set to Follow or Position Composer. Finally, set the Lens properties for your projects. Keep in mind that some options will be inherited from the main camera’s properties.
In the Position Composer component find useful options to modify how the Virtual Camera follows its target, such as Offset, Damping, Dead, and Soft Zones. Experiment with these options during Play mode, and the changes will be saved if you check the Save During Play option.
There is also an extension for the Virtual Camera, the Cinemachine Confiner 2D, which, when activated, limits the camera from moving outside Level bounds, ensuring the player will see only the parts that you want them to see. It also ensures you don’t need to design unnecessary parts of the level.
To add Cinemachine Confiner 2D, select it from the Add Extension dropdown menu.
Cinemachine Confiner 2D requires a Collider 2D (Composite or Polygon) as a Bounding Shape 2D. Create an empty GameObject, and add a Composite Collider 2D and Box Collider 2D. A RigidBody 2D will be added automatically; set its Body Type to Static. Also, check the Used by Composite option on the Box Collider 2D. Now, drag this GameObject into the Bounding Shape 2D field of the Cinemachine Confiner 2D script. Don’t forget to edit the size of the Box Collider 2D so that it’s larger than the size of the camera.
The Collider 2D called CameraBounds prevents the camera from showing beyond the boundaries.
Now the camera’s frustum won’t go out the bounding box of the collider. For more details, check the Cinemachine Confiner 2D documentation.
Contributors
Original author
Jarek Majewski is a professional 2D artist, tech artist and self-taught Unity developer with extensive C# scripting skills. He has created art for mobile and console games. Besides his professional work at game studios he is working on his own game Ultimate Action Hero, currently in development and which placed second in the 2019 Unity 2D Challenge.
Jarek was the art director and artist for the Unity 2D samples Dragon Crashers, Happy Harvest, Gem Hunter Match and Bunny Blitz.
Unity contributors
Eduardo Oriz led the production of this guide. He is a senior content marketing manager at Unity with many years of experience working with game development teams. He works closely with the 2D tools team, and has a broad understanding of what Unity offers to game developers and studios.
Rus Scammell is the product manager on Unity’s 2D development team. Rus has over 15 years’ experience in game and software development. He uses his extensive knowledge of games technology to ensure that Unity 2D tools and workflows are accessible to artists, programmers, and game designers.
Melvyn May is the main developer of Unity’s 2D physics system, and a key collaborator in the creation of the Bunny Blitz and 2D physics samples. Melvy is active in the Unity community, often seen in Discussions threads answering users’ questions.
The rest of the 2D development team at Unity contributed by reviewing and validating this guide and are excited to see what 2D games users will create in Unity, in 2026 and beyond.


