---
title: "Unity UI: Cast Time HUD"
description: "In this tutorial we'll add a HUD showing the cast time of a combatant. We'll use the *Combatant Object* HUD type, i.e. the cast time HUD will be shown directly at the on-screen position of the combatants. This tutorial is based…"
url: "https://orkframework.com/guide/ork4/ork4-tutorials/ork4-ui-tutorials/unity-ui-cast-time-hud/"
updated: "2026-08-31"
category: ORK 4 Tutorials / UI Tutorials
---

# Unity UI: Cast Time HUD

In this tutorial we'll add a HUD showing the cast time of a combatant.

We'll use the *Combatant Object* HUD type, i.e. the cast time HUD will be shown directly at the on-screen position of the combatants.

This tutorial is based on the [ORK 4 Unity Quickstart 3D tutorials](https://orkframework.com/guide/ork4/ork4-tutorials/ork4-unity-quickstart-tutorials-3d/ork-4-unity-quickstart-3d/) using [active time battles](https://orkframework.com/guide/ork4/ork4-tutorials/ork4-gameplay-tutorials/ork4-adding-active-time-battles/) and [cast times](https://orkframework.com/guide/ork4/ork4-tutorials/ork4-gameplay-tutorials/ork4-cast-time/), but can be used in any project. Your project's UI system should already be set to *Unity UI*. If not, check the [initial setup tutorial for Unity UI](https://orkframework.com/guide/ork4/ork4-tutorials/ork4-ui-tutorials/ork4-unity-ui-initial-setup/).

As with all content when using *Unity UI*, we'll set up prefabs. It's best to do this in the *UI Environment Scene*, so open it.

# HUD Prefab Setup

We'll start with the prefab for our HUD, we'll simply display the combatant's cast time using a value bar - no text or anything else.

Use the scene hierarchy context menu (**ORK Framework > HUD > HUD**) or [ORK toolbar](https://orkframework.com/guide/ork4/ork4-documentation/ork4-editor/unity-overlay-toolbar/) (search for: **HUD**) to create a new base HUD (without any layout).

Let's adjust the *HUD* object to our needs.

## Rect Transform

Since we'll use the HUD at the position of combatants on screen, we'll only set the width and height and can ignore the positioning.

- **Width**
   Set to: *150*
- **Height**
   Set to: *30*

## Image

Add an *Image* component to the *HUD* object. We'll use it to add a background image to the HUD.

- **Source Image**
   Select: *BoxBlue* (or any other sprite you like)

## Value Bar

Add the value bar to the HUD either using the scene hierarchy context menu (**ORK Framework > HUD > Content > HUD: Value Bar (Sprite)**) or the ORK toolbar (search for: **HUD Bar Sprite**).

### Rect Transform

We'll adjust the position to show the value bar nearly filling the whole HUD.

- **Left**
   Set to: *5*
- **Top**
   Set to: *5*
- **Right**
   Set to: *5*
- **Bottom**
   Set to: *5*

### HUD Value Bar Content

This component is responsible for what the value bar will actually represent.

We'll change it to show the cast time- the timebar will only be visible in active time battles automatically.

- **Value Type**
   Select: *Cast Time*

### Empty and Value Sprite

The *Empty Sprite* child object of the value bar shows the empty bar, the *Value Sprite* shows the filled part of the bar.

Select both at the same time and change the used sprite:

- **Source Image**
   Select: *White_16x16*

## Create Prefab

The complete HUD will look like this:

[![](https://orkframework.com/wp-content/uploads/ork4_tutorials_gameplay__cast_time_hud.png)](https://orkframework.com/wp-content/uploads/ork4_tutorials_gameplay__cast_time_hud.png)

Create a prefab out of the *HUD* object, e.g. naming it *Cast Time HUD*.

If you've done the setup in one of your game's scenes, don't forget to remove the canvas (with the *HUD* object).

# Cast Time HUD Setup

Open the ORK editor, navigate to **UI > HUDs** and add a new HUD.

The HUD will use the *Combatant Object* HUD type, i.e. it'll be displayed based on the position of a combatant's object. We'll also only display it when the combatant is casting.

## HUD Settings

- **Name**
   Set to: *Cast Time*
- **HUD Type**
   Select: *Combatant Object*
- **Auto Display**
   *Enable*

## Combatant Settings

- **Player/Ally/Enemy**
   *Enable*

We'll display the HUD based on a child object of the combatant.

- **Child Object**
   Select: *Path*
- **Find Child**
   Set to: *Cursor*

## Display Conditions > Combatant Requirements

Click on *Add Status Condition*.

- **Condition Type**
   Select: *Status*
- **Status Needed**
   Select: *Is Casting*
- **Is Casting**
   *Enable*

## Unity UI

- **UI Layer**
   Select: *HUD*
- **HUD Prefab**
   Select: *Cast Time HUD*

## Save Changes

And that's it!

Don't forget to save your changes by clicking on *Save Settings* at the bottom of the editor.

# Testing

Hit play and start a fight!

 [https://orkframework.com/wp-content/uploads/ork4_tutorials_gameplay__cast_time_demo.mp4](https://orkframework.com/wp-content/uploads/ork4_tutorials_gameplay__cast_time_demo.mp4)

The cast time HUD pops up whenever a combatant uses an action that has a cast time.
