“trible shot” power-up logic
So our logic is going to be almost identical to our Enemy!
We want the power-up to move down the board, but instead of respawning at the top in a random place we want to destroy it. We also want it, when it collides with the Player, to be absorbed and enable Triple Shot!
In the Player script, we want to first create a function that can be accessible to the Powerup script that allows us to enable Triple Shot:
With that we can move into our Powerup script and begin the logic for the power-up. For movement, we want it to translate downwards, and once it hits the bottom of the screen we want it to be destroyed!
We now need to create a collision trigger that activates when the Player collides with the power-up, enables triple shot and destroys itself: