Extending Space Shooter

Hi, in my space shooter game, i have extended it to have more different hazards, and a different player ship. However, i would like to add a power up so when the player collects the power up drop, there is a timer that counts down from 30, and gives the player a tri-bolt shot ability for the 30 seconds. How would i be able to do this?

I have it set up so the ship collects the cube, but then nothing happens. How do i set it so that when the cube is collected, the player fires a tri-bolt shot for 30 seconds? Does anyone have any ideas?

I have the tri-bolt shot set up as well, just need the code in c#

Hi,

Why haven’t you try implementing this in C#; where are you stuck exactly?

I have tried multiple times. Here is what im trying to do:

Upon collecting a cube, i want the player controller script to disable (need to know how to code the disable function)
After 30 seconds (need to know how to create a timer code) the original player controller script is enabled.
In those 30 seconds, instead of firing a single bolt, im trying to fire 3 bolts, or a triple shot.

I need to know how i could disable a script for 30 seconds, then when the timer is done, the script is enabled again… Hope this clears things up!

I have 2 scripts; there is the PlayerController Script, which has the single fire bolt shot.
Then there is the PowerAbility Script, which has the triple fire bolt shot.

When the cube is collected, i want the PlayerController Script to be disabled for 30 seconds, and i want the PowerAbility Script to be enabled for those 30 seconds. Both Scripts have the same movement and tilt controls, the only difference between the 2 is the weapon…

Enabling/disabling scripts is fairly simple:

In this case, it sounds like you should split the movement/tilt part of the script from the weapon part; then you wouldn’t be duplicating it unnecessarily.

Thanks for all the help!

Only thing with that the script in the link is that ive tried it in my game, but it doesnt work. I dont know if its something im doing wrong, and i dont know how to fix it/ really set it up on my own as im fairly new to Unity…