Moving past prototype: importing artwork (Game Dev day 14)

Jack Leavey
2 min readJul 26, 2021

--

Let’s take one last look at our prototype before beginning the process of importing art assets.

Our proof of concept (prototype).

Now let’s see what it looks like with a few simply art assets added in.

Look at how much of a difference art can make!

Fortunately, importing assets in Unity is extremely simple. Let’s start with setting up our background “Galaxy”.

Our background asset.

To set this up, all we need to do is add a sprite renderer to our “Background” object in our hierarchy, then drag the asset we want into the Sprite renderer

Adding a sprite renderer.

Now, we need to attach the appropriate sprite to this.

Attaching the sprite.

We can move the sprite around in the scene window if it isn’t in the correct place, but that won’t be necessary here.

The last step is to set the layer that this art asset rests on. In 2D environments, all of the object are sitting on top of each other. We want to make sure that the Background is always at the very bottom of that pile.

We can make ourselves some sorting layers inside the Sprite Renderer.

Make some new layers. I made “Foreground” and “Background”.

Now we set the Background to the Background layer. The layer order goes from top to bottom, with the topmost layer being the LOWEST layer. In the above example, it means that the background will ALWAYS be lower than anything placed in the “Foreground” layer.

Now we can do the same process for our Enemy, our Laser, and our Player objects! Make sure they are all on the Foreground layer, or they might appear behind some of the background stars. Make sure you apply the sprite to the Prefabs, and not just one object in the scene window!

--

--

Jack Leavey
Jack Leavey

Written by Jack Leavey

I am a software engineer with years of experience branching into game development, specifically in Unity. Follow along for guides on creating game mechanics!

No responses yet