Determining How Long Powerup Effects Should Last- Game Dev Series 17

Objective: Make the triple shot powerup each time would only last for 5 seconds.

Previous: Make an Animation with Sprites

Every powerup or buff should has a limit. Since we have a bool to switch between 1 shot & 3 shot, we can easily create this limit in code.

Open the Player script and add an IEnumerator. Within this coroutine function, we will switch the bool to false after 5 second when active.

Then add a StartCoroutine callup in TripleShotActive().

Then it should work! We can Play it to check the result.

--

--

--

A passionate gamer whose goal is to work in video game development.

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

Recommended from Medium

Using Approov in Your Cordova App the Easy Way

Conditional And Iterative Statements Important Questions class 11 computer science with python

Learning to Use Go Reflection

Dev 1.03 | Sprint 3 [11.5.2020–11.26.2020]

Delete All Git Branch Except 1 With Bash Script

Blogs: Week of 29 Mar — 4 Apr

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
S.J. Jason Liu

S.J. Jason Liu

A passionate gamer whose goal is to work in video game development.

More from Medium

What is a Control Track in Timeline

My Optimal Scene & Project Unity Layout

My journey becoming a Unity game developer: Make a game look beautiful-Creating support struts for…

Day 105: Working with Animation Events in Unity