Day 8: Creating an offset

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.

--

--

--

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

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

My Google Code-In 2017 Experience

ZERO DOWNTIME IN SERVER UPDATE

3 Best way to learn coding

Deploying High Availability CDN Architecture on AWS Using AWS CLI

Messenger Bot using Flask and API.AI

Parsing JSON and CSV’s with Go at scale

Boss Arriving Part-1: Movement- Game Dev Series 52

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Jake Boere

Jake Boere

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

More from Medium

Creating a HUD

My journey becoming a Unity game developer: 2.5D

Day 21 of my Developer Journey: UI and Score

Making Moving Platforms In A Unity Platformer