Road TO Dev — Setting up player to fire Tripleshot!

Ok so now that we have a visual for our powerup and because we copied the laser prefab it has movement let’s setup our player to use it. First we need to tell the player what the game object is even and attach the prefab to our player.

Now we need to tell our player to instantiate this game object instead of our regular laser but only when we collide with the powerup. We already setup some of this logic so that when the powerup collides we trigger TripleShotActive. So now we just need to setup our Fire() to use it.

First we need to setup our powerup script to communicate properly and because we have a tag associated with the player already in the collision we can utilize that. Don’t forget to null check.

Now let’s have our player react to the triple shot being active!

Also in our tripleshot prefab we need to remove the laser script from the children. Only the parent needs it just make sure they all have the tag Laser still.

Now let’s test it out!

--

--

--

Hi there! I am currently on the path to learn how to become a unity developer and will be documenting my journey as best as I can here. Thanks for looking!

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

Recommended from Medium

A vendor license audit by any other name… is still an audit

Create your first Pull Request here!

Using distributed tracing to improve logging and debugging processes

How to install and run a whois in Windows 10

AWS — Using Elastic Beanstalk to Launch Your Application

How to Use the Cognitive Service from Microsoft (LUIS) with Bot Builder

Sorting Techniques 2.0

Why and how to start a web developer career?

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
Rob Smith

Rob Smith

Hi there! I am currently on the path to learn how to become a unity developer and will be documenting my journey as best as I can here. Thanks for looking!

More from Medium

Unity’s Tilemap System

Spicing up our enemy movement

Bug Fix on Model Flip

Learn to code by making a 2D space shooter game.