Day 11: Instantiating the triple shot prefab

Jake Boere
2 min readMay 16, 2021

--

Objective: We need to instantiate the triple shot prefab but make it so that it doesn’t stay on.

First, in your player script we need to set up the pseudo code which will be if the space bar is pressed and the triple shot is active then we want to spawn the triple shot prefab otherwise we want to spawn the normal laser.

Then, you need to add the variables for the triple shot that we will need which will be a game object variable to hold the prefab and then we will need a bool to check if the triple shot is active make sure it is set to false and serialize it to help test if your code works.

Next, fill in your pseudo code working with the if statement put the space bar input in then your bool for if the triple shot is active in the condition for the if statement. Then do your instantiate method, followed by the else statement that shots the normal laser when the triple shot isn’t active.

--

--

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