Unity Guide

Creating a power-up for your game in Unity

A quick guide about how to implement a power-up item in your game with Unity

Creating the power-up prefab

Move the laser prefabs as you wish.

Creating the game mechanic

_tripleLaser will store the triple shot prefab and _tripleShotEnabled will decide if the power-up is enabled.
We don’t need to add a new vector to the initial position of the triple shot as we already saved the prefab into the position we wanted.
Voilà! the player shoots the triple shot when the power-up is enabled.

Creating the collectable power-up prefab

Resize the sprite as you wish.

Implementing the power-up collection mechanic

Choosing a random X position between the limits will position the power-up item where the player can collect it while it goes down.

Nerd For Tech

From Confusion to Clarification

Nerd For Tech

NFT is an Educational Media House. Our mission is to bring the invaluable knowledge and experiences of experts from all over the world to the novice. To know more about us, visit https://www.nerdfortech.org/.

Fernando Alcantara Santana

Written by

A passionate computer technology engineer and Unity developer that is always looking to grow in every aspect of life :).

Nerd For Tech

NFT is an Educational Media House. Our mission is to bring the invaluable knowledge and experiences of experts from all over the world to the novice. To know more about us, visit https://www.nerdfortech.org/.