Creating Modular Powerup Systems

  • Each powerup is a prefab, a GameObject
  • The behaviour of each powerup can be set using a switch statement in OnTriggerEnter function
  • In the script, we create an array of type GameObject to include all the powerups
  • The powerups must be assigned in the Editor
  • For instantiating powerups randomly, Random.Range can be used




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

Recommended from Medium

C# Challenge - Controlling Rigidbody Gravity

Building AJIO lite

Virtual Python Workshop: Exploring Environmental Data with pandas and GeoPy

A gravel pathway leads to a lake’s edge.

Deno nuggets: Download a file in Deno

Integer Caching in Java

Ever since I was a little boy, I have only ever wanted to be a Doctor.

DC vs RR Dream11 Prediction, Fantasy Cricket Tips, Playing XI, Pitch Report & Injury Updates For…

IPL Fantasy Tips

Filtering lists based on a Helper entity.

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
Hernando Nieto Jaramillo

Hernando Nieto Jaramillo

Unity developer

More from Medium

Separate or project repository to store tests? Which, why, and when?

The role of global and local agendas for Universal Health Coverage: Part 3 — Q&A with UHC experts…

Assignment #3 — What does the Internet really look like?

Designing the Perfect Pitch Deck