Creating Modular PowerUp in Unity!

Creating a variable

  1. TripleShot / 2. SpeedUp / 3. Shield
  • TripleShot = 0 / Speed = 1 / Shield = 2

In Player Script

  • TripleShot: Use ‘bool’ to activate or deactivate (we created this previously)
  • Speed: Use ‘float’ or ‘int’ to increase or decrease number (we created this previously as well)
  • Shield: Use ‘bool’ to activate or deactivate.
Variables for each PowerUp
  • TripleShot: we went over this in the previous article.
  • Speed: we can set it to 10 when activated and return to 5.5 when deactivated.
  • Shield: create a bool statement similar to TripleShot (We will go over how to instantiate this in the next article. Stay tuned!)
Coroutine for each PowerUp

In PowerUp Script




XR Unity Developer / Designer / Architect

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Learning A Few Additional Operations in MATLAB

Instantiate & Destroy Gameobjects + Cooldown system in Unity

Speaking at BIWA Summit 2017

Why you need to write pseudo code

Learn how to orchestrate serverless functions by scraping APIs in 8 minutes

What are the benefits of low-code development?

CLI Project-PoGo API

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Du Young Yoon

Du Young Yoon

XR Unity Developer / Designer / Architect

More from Medium

2.5D Platformer — Improving the Ledge Grab #10

Creating a Retro Game Over Behavior

Creating a “negative” powerup

Quick tip — Upgrading your Unity project to High Definition Render Pipeline (HDRP)