Prototype to Product

Christopher Pearl
2 min readJul 7, 2021

Now that my space shooter is functioning like a real game, its time to make it look like a real game! I imported a few space sprites to add some shine to my galaxy warzone!

Adding Background Sprite

I first switched to 2D mode. From here, I dragged and dropped the player sprite on the hierarchy. By rebuilding the player, and then attaching the scripts and physics components (rigidbody, colliders), it made the process a lot easier than converting the player 3D prototype cubes to 2D sprites.

Fixing Enemies from Scratch

I deleted out the components on the enemies prototype and added the enemy script, sprite renderer, and a rigidbody2D. Within the Rigidbody, I turned the gravity scale down to zero, since I’m not using gravity in this game. Then, I added a 2D Box Collider and checked the Is Trigger box so the colliders work correctly.

From here, I dragged in a sprite for my laser and rebuilt the gameobject. I shrunk it down so it would look a bit more realistic as it shoots from my spaceship shooter. I also added a Rigidbody2D so it would work in the 2 dimensional format of the game like the enemies and space shooter.

Adjusting code

In order for the colliders to work in Unity, the original OnTriggerEnter() method needs to be adjusted to 2D to detect the two dimensional assets that I replaced the cube prototype objects with. This will allow the scripts to work correctly. Also, I had to retag the Laser as Laser in the Inspector, so the laser would be triggered correctly and collide with the enemy ships.

Now my space shooter is looking like the fun game I wanted it to become! It’s almost time to play!!!

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

Christopher Pearl
Christopher Pearl

Written by Christopher Pearl

Unity/Unreal Developer, Artificial Intelligence Specialist, AR/VR Developer

No responses yet

Write a response