Determining How Long Powerup Effects Should Last

  • In Powerup script, in OnTriggerEnter, create a way to communicate with Player script to activate the powerup
  • Create a function to change its value to true and call the coroutine
  • Create a coroutine to define how long the powerup will last. We will use a 5 seconds delay using
yield return new WaitForSeconds(5f);
  • Start the coroutine: it can be started in Start( ) function or in another one, in this case, in ActivateTripleLaser( )

--

--

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