Day 10 of my Developer Journey: Prototype to production (3D to 2D)

Marek Ondrej Valco
2 min readJul 5, 2021

Now that the basic framework is done, we need to change the simple cubes to more complicated assets. Firstly, we will select the 2D button in our game window. Next we will add a nebula background.

New 2d view and background

First thing we change is our player from a cube to a 2D ship and modifying our components to suit our new needs. We will also adjust our Box Collider to suit our new sprite. After we are finished, these are our new components:

Player Components

Next is our new enemy. We will add the same components, add the 2D sprite and then fix the Colliders. Same goes for the Laser, then both were tagged correctly. Important to note is the selection of the objects being triggers, so there are no Once, this is done, both are added to the Prefab folder.

Now its time to fix the code. In the enemy code we need to fix the colliders, as they are looking for a 3D object, now that the objects are 2D, it requires some change.

Changes in the Enemy code

Last thing we will change is the laser offset. Since our new model is different, our laser spawn position needs to be changed.

New Laser spawn position

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

No responses yet

Write a response