From 3D Prototype to 2D Assets, Part 2 — Convert 3D GameObject to 2D

Last time we got as far as our Background, and our game already pops. But to be truly 2D, the rest of our 3D assets have to be converted.

We’ll go through 2 ways to convert 3D GameObjects into 2D. We’ll have some bugs to fix, and that will be the topic of Part 3!

Converting our Player; starting from Scratch

Sometimes, starting from scratch is a much better path to take. Thankfully, there is not much on our Player and it is not very intricate to rebuild in 2D form.

The most important part of our Player right now is the Player Script attached.

The important bits!

And since we have that Script in a folder, ready to be used on ANY object, we can just delete our Player from the Scene Hierarchy and start new!

Goodbye 3D Player Cube! We’ll miss you!

Now, a blank canvas, we can bring in a Sprite image of our NEW Player, and drag it into the Scene Hierarchy (and remember to re-name it too!):

Dragging in a Sprite!

This is essentially our New Player Game Object. It’s just a little incomplete right now. For one, it doesn’t have a Player Script attached. The other important parts are the Box Collider 2D and Rigidbody 2D (so that the Player can interact with other 2D objects).

You must remember to use the 2D versions of the Box Collider and Rigidbody. This is important later when interacting with the code!

Adding some components!
  • Remember to set the Collider to a trigger
  • and for the Rigidbody, make sure the Gravity scale is 0!

Converting our Laser Prefab; convert from the inside-out.

Sometimes, you want to keep your Prefab intact and not create a new GameObject from scratch when converting to 2D. That’s fine too, you just have to remember everything!

For this, we’ll jump into the Laser’s Prefab window by double-clicking the Laser Prefab in the Project Window.

The Laser Prefab window — zooms in on the object, and is easily denoted by the dark-blue background in the Scene window.

Now we can delete every component, EXCEPT the Laser script:

Components be-gone!

Then just like previously with the Player, we add a Box Collider 2D and a Rigidbody 2D.

Then the important part is to add a Sprite Renderer — this allows us to drag a sprite onto the object, that we can actually see! Our Laser would be invisible without our renderer!

Now that we can see our Laser, we can fix up the Box Collider 2D to fit the sprite appropriately!

Drag a Laser sprite onto the Sprite Renderer Component, then fix the Box Collider!

And GRAVITY SCALE:

Zero Gravity, please!

The Enemy

Well, this one is up to you. You now can choose a preference in which method you like to use.

For me personally, I chose option 2 because it was already a Prefab. But you can create an entirely new Enemy GameObject if you want!

We have the Sprites converted to 2D, but unfortunately that’s not the end of our conversion process! We still have some bugs to fix:

Some bugs are creeping into our game!

We solve those in the next section!

Audio Engineer turned Unity Game Dev. Will be combining both my skillsets when appropriate, and will be documenting my Unity Dev growth in these Medium Articles