2D Shooter: Negative Powerups
Objective: Create a powerup that decreases the player’s speed.
First let’s create visual. I basically just grabbed the speed powerup, renamed it, changed its color, changed the powerup ID, and turned it into a new prefab.
Now in the player script, lets make the method and a coroutine pretty much exactly like the speed boost powerup, except we’ll be subtracting.
Now let’s make the changes to our spawn manager, by assigning this to the 7th slot (element 6) of our array.
Don’t forget to change the range values in the code.
And finally to call the method in the powerup script.
Now we’re done!