Implementing a radial timer
In this recipe, we are going to create a radial timer. The time that is remaining will be displayed as a ring that reduces circularly over time. To achieve this, we will use the Image (Script) component, along with a script to manage the length of the circular bar. A timer like this can be useful when it is relating to something in particular. For instance, if a character has a special ability and we want the timer to represent the duration that the ability can be used for, a radial timer can be implemented. In this way, we are able to add an icon that then represents the ability. It can be centered in the middle of the radial timer, keeping the UI concentrated and contained.
How to do it...
- First of all, we need to create a circular bar for our timer. We can do this by opening a graphics program to make it, or by implementing the one that we previously created in the Implementing a radial heath bar recipe in the previous chapter.
- Next, import the bar into your...