From Prototype to Work of Art in Unity

Rusben Guzman
May 27, 2021

--

In this challenge the objective is modify the player prefab to make it look like a spaceship. I’m gonna work with 2D sprites so the first step is to remove the mesh filter, mesh renderer and box collider.

Now we’re gonna add the 2D components “Sprite Renderer”, “Box Collider 2D” and the collider have to be a trigger.

Then in the sprite renderer component we have to assign the sprite for the player in this case the spaceship.

Finally in the enemy script we have to change the OnTriggerEnter Method by OnTriggerEnter2D to detect the collisions with 2D components.

Change OntriggerEnter(Collider other) -> OnTriggerEnter2D(Collider2D other)

After this process we have as a result the player with the same capabilities but with a quite better look.

--

--

Rusben Guzman
Rusben Guzman

Written by Rusben Guzman

A Software Engineer passionate about game dev and interactive products with Unity. I consider video games to be the artistic expression of programming.

No responses yet