Unity 2D - Closed 2D Sprite Shape - Platformers and Top Down
In this Unity 2D tutorial, I'll cover using the Unity Closed 2D Sprite Shape to create platforms for platformers and for Top down 2D games. (to Join my discord server add a comment and I'll reply with the latest invite code) ► Download Playmaker at https://bit.ly/3dV8JzC ► Download Unity at https:
Unity's Closed 2D Sprite Shape is a fast way to build terrain for both side-scrolling platformers and top-down scenes. The key idea to grasp up front is that a sprite shape automatically rotates your edge graphics around the outline, so a single artwork can wrap the top, sides, and bottom of a shape. This guide walks through setting up the package, building a rock platform, and then reusing the same tool for a top-down island.
Installing and Creating the Shape
The Sprite Shape feature comes from a package. If it is missing, open Window then Package Manager, switch to the Unity Registry, and search for 2D Sprite Shape. Once installed, add a simple sky background by creating an empty sprite, recoloring it to a sky tone, and sizing it. Then create a Sprite Shape and choose Closed rather than Open. Move its order in layer in front of the sky. A closed sprite shape has a Sprite Renderer and a Sprite Shape Controller; clicking Edit Spline exposes nodes with handles you can drag, and you can add nodes to reshape it. The tangent mode per node can be set to a hard corner or a continuous edge, and continuous gives the smoothest result.
Building the Rock Platform Profile
Create a 2D Sprite Shape Profile named rock platform. Add a fill texture by dragging in a rock fill graphic; to make it tile cleanly, select that texture and set its Wrap Mode to Repeat. By default the profile uses a single angle covering the full 360 degrees, so narrow the top range to roughly 45 to negative 45 and assign a grass block top sprite there. As you drag the spline, you will see the sprite rotate to follow the edge. Add more angle ranges by clicking within the outer ring, then assign grass block right, grass block bottom, and grass block left to their sides, dragging the handles to adjust each range.
Placing and Refining
Drag the profile straight into the scene to use it. If it hides behind the sky, set the sky's order in layer to negative 1. To stop the edge sprites from tiling poorly, open each edge sprite, set its Mesh Type to Full Rect and Apply, then in the Sprite Editor define a left edge and a right edge with a tileable center using border settings, and Apply to each. Now you can edit the spline, add points, and switch nodes between linear and continuous to grow a larger platform with clean edges.
Reworking It for Top Down
For a top-down island, deepen the background to an ocean blue. Create a grass profile that has only a fill, deleting all corner and angle sprites, and drop in a grass fill. Add nodes and uncheck Is Open Ended to close the shape, setting nodes to continuous for a soft island outline. Then make a separate cliff edge profile that uses one cliff edge graphic across the entire angle with no fill, drag it into the scene, close it as well, and match its outline to the grass. Set the cliff's order in layer to 0 and the grass to 1 so the grass sits in front, leaving a finished island in the middle of the ocean.





