Day 8: Creating an offset

Jake Boere
May 7, 2021

--

Objective: We need to make it so that the laser doesn’t fire from in the player and clip though so we need to make an offset so the laser spawns above the player.

To do this we need to edit our instantiate method since that is what handles the spawning of the laser. So, the pseudo code for this will be, we need to add a new position on the Y axis for the laser to spawn from the players position.

We can do this by adding a new Vector3 and just add 0.8f on the Y position. Once you’ve done that your offset should work but if not you should test it and keep tweaking it until you get the result you want.

--

--

Jake Boere
Jake Boere

Written by Jake Boere

I am hard working Game development student learning as much about game development and unity as possible.

No responses yet