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

Ping Pong Pair Programming

Introducing shapes

Try This Top API For Cobalt Prices In 2022!

Deploy a Django application with Caprover PaaS

Pythonic Way Of Doing Things

Why Automate IT?

Annoucing the Neurotech SF VR Hack #3: Brainduino WebXR Oculus Go.

More Productive Editor Layout in Unity

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

My journey becoming a Unity game developer: 2.5D Infinite Runner-Ledge Grab System-Pt3

Get Started Your First Mobile Top Down Shooting Game Development With Unity Visual Scripting Part 9

Restarting a Scene in Unity

2D Mobile Game: Enemy Class Shared Behavior