Make the Pewpew — Laser Time

Cliff Bailey
2 min readJul 7, 2022

--

If there’s one thing space shooter games are full of, it’s LASERs. So let’s go ahead and set up our primary projectile as a prefab so we can instantiate the crap out of it without expending too much on our systems.

Create a capsule in your hierarchy.

Right-click -> 3D Object -> Capsule

Go ahead: rename it and claim it — from Capsule to Laser.

If it’s not already at LocationZero, zero out its x, y, z coordinates in the object’s transform.

You’ll find the Location component is more than meets the eye.

Scale it down a bit, too, to an appropriate size you think looks good for your setup of a laser bolt relative to the spaceship that shoots it.

For me, I scaled it down to .2, .4, .2.

Now drag the Laser object from the Hierarchy into your Prefabs folder.

Now right+click in your Materials folder and create a new material and call it something like Laser_MAT.

In the inspector, change the color from white to a nice lasery color. I’m going with killer blue.

And if you’re feeling daring, check the Emission box and make the color the same as your Albedo so your laser bolts will LIGHT UP the screen (sort of).

Alrighty — you’ve got your laser prepped, let’s move onto laser behaviour in the next article!

--

--