Unity Prototyping: Creating A Cooldown System

Prototyping gives you the freedom to test out your design ideas and find out what works before investing too much time or money into making a full-scale game development project that may never see the light of day.

In this guide I will describe a cooldown system. Cooldown refers to the amount of time a user must wait before repeating the last action performed. Cooldowns are often used in video games for balancing purposes. Cooldowns ensure that players cannot spam the same action repeatedly.

In our example, we will try to constrain the laser frequency, which is dependent on the speed of spacebar clicks. We will program the function in such a way that the laser is generated in a constant way despite the very fast repetitive spacebar clicks.

Look at the “PlayerLaser” function, here we have a dependency on the spacebar click and the time that should elapse before the next laser shot is generated.

Prototyping gives you the ability to test out new game concepts easily and quickly, even before you have the full game resources created yet. With the right tools, it takes less than a day to create something playable that will help you evaluate if what you’re working on is worth continuing with or not.

--

--

--

Hi, I’m Damian, a Unity Software Engineer who loves building education and simulation games.

Recommended from Medium

DotVVM Meetup on 22nd April

Learning Python with Interview Questions 3

Java XChart-An alternative JFreeChart

How We Ignore DB Index Field in Hybris

Controlling the Serial and Parallel Test on XUnit

Robotic OS — Embedded Computer Vision on Raspberry Pi 4

What is Terraform and why your infrastructure should be written as code

hands of factory worker with sparkles of light

What makes Great Software Company

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
Damian Dąbrowski

Damian Dąbrowski

Hi, I’m Damian, a Unity Software Engineer who loves building education and simulation games.

More from Medium

Damage VFX Using Animated Sprites In Unity

How to Win the Race Using Director

Unity Tutorial — Toon Shade in HLSL

Animating Sprites in Unity