Creating Modular Powerup Systems
May 21, 2021
Objective: Creating a modular system for your powerups with powerup ID numbers.
Press enter or click to view image in full size![]()
After creating this variable you can now access this in the inspector view and set the values accordingly.
Press enter or click to view image in full size![]()
With this ID variable we can insert an if statement inside our if statement into the OnTriggerEnter method.
Press enter or click to view image in full size![]()
Press enter or click to view image in full size![]()
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.