Creating Modular Powerup Systems

Objective: Creating a modular system for your powerups with powerup ID numbers.

After creating this variable you can now access this in the inspector view and set the values accordingly.

With this ID variable we can insert an if statement inside our if statement into the OnTriggerEnter method.


Use the Debug.Log to test if new powerup collisions register correctly.

With this in place you could easily add more powerups to the same script.

That’s all there is to it, you’ve now built a modular powerup system.



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