Photo by Mingwei Lim on Unsplash

Side Note: Importing 2D assets (Originally “Creating Custom 2D Assets using Filebase”)

Michael Little
4 min readDec 21, 2022

--

This isn’t a required segment especially during this part in the course, but I see the necessity for it as I’m creating a 2D space shooter and currently have 3D assets that haven’t been ‘snapped’ to a spritesheet or converted to 2D sprites.

This journey begins with opening up filebase (GameDevHQ’s online asset store) and downloading what’s called a transparency plugin.

So first, we type systems extensions in asset search where we can download our transparency plugin from there.

And, if it wasn’t obvious, anytime we’re working on manually converting 3D assets to 2D sprites (or anything else of the like), we want to open up a separate new project for that. The files will be created with a fresh open background, and when they’re done, we can then drag them into whatever project we’re working on. In this case, my 2D space shooter.

Our transparency plugin in this case is called the transparent background and as you can see, I already had it downloaded.

In some cases, after we have the desired view of our object, we would adjust things like dynamic lighting via the directional light, but I’m not too concerned about that at the moment. What we want to do is center or ‘snap’ the camera on the object in question. You do this by holding CTRL, Shift, and pressing the ‘F’ key at the same time.

Next, we want to take our transparency background script after we imported it, then drag it into the camera in hierarchy.

As you can see, I set the frame rate and frames to capture both to 1. This is because I’m going to be snapping very simple 2D sprites here.

We also want to set our clear flags from skybox to solid color:

And just for reference, the transparency background script has all the steps listed:

That means after turning ‘Maximize on Play’ on in game view, we are now on step #4, and I believe the resolution is fine where it is. So, we’re now literally on taking a snapshot of our object:

Okay, new plan. I’m doing everything as instructed, even had a professional look at it, but for some reason, it’s not snapping the pic (This will be covered in the next story).

So, what I decided to do was look up 2D assets on another site, in this case, www.opengameart.org and adjust the file from there so it’s suitable to implement in-game.

Not the most ideal way to go about it but a necessary workaround for the time being.

What I did was drag the image (which is already 2D) into assets in project view, turned Texture Type to ‘sprite (2D and UI)’, Sprite Mode to ‘Single’, checked the Alpha is Transpose box, and made sure it was set on ‘Input Texture Alpha’.

At that point, it’s good to drag into the hierarchy and attach components/scripts from there.

I can cover something else here I just found out on my 2nd run, how to manually animate 2D sprites.

Now unfortunately I’m referring to the entire color of the sprite, not one little section, for that, I’m assuming you’d need a photoshop app. This is also after converting the 3D game object into a 2D sprite in the photoshop app, which again, is covered in the next story.

Now, you’ll want to make sure that your game object is in the same exact position as the different colored sprites you’ll be snapping, otherwise not only will the colors change in your animation, but your position will as well.

It’s literally as simple as changing the color as you see fit, snapping the pic (which is covered in the next story) then dragging the files into your intended project.

The assets with the squares next to them can be applied as Game Objects. The originals are the ‘snaps’ I took, then dragged into this project. You simply create an animation like I covered in prior stories and drag those very sprites into it as desired.

--

--

Michael Little

I'm currently pursuing my passion for game development. This is where I document education pertaining to that and software engineering. No personal Dev diaries.