Unity UI Scripts

6 free C# scripts 3 beginner3 intermediate Unity 2022.3+ MIT licensed

These scripts cover the in-game UI most action and RPG projects need. A health bar with smooth fill and a damage flash, floating damage numbers, a screen fader for scene transitions, a tooltip that keeps itself on screen, and a minimap drawn from a render texture.

They are built for Unity's Canvas-based UI (uGUI), so each needs a Canvas in the scene, and Health Bar UI reads from the Health System through its events instead of checking every frame. Health Bar UI Pro adds a delayed damage trail, shield overlay and a boss-bar mode.

Start with Health Bar UI

World-space or screen-space health bar with smooth fill, color gradient, and damage flash. Attach to enemies or use as HUD.

HealthBarUI.cs · 8 Inspector fields · beginner

Open Health Bar UI
HealthBarUI.cs
Script HealthBarUI
References
Fill Image None (Image)
Background Image None (Image)
Fill Settings
Smooth Speed 5
Color Gradient None (Gradient)
Damage Flash
Enable Damage Flash
Flash Color
Flash Duration 0.15
Billboard (World Space Only)
Billboard To Camera

All 6 ui scripts

What these scripts need

Read from each script's source, so this list stays in step with the code.

  • Uses uGUI (UnityEngine.UI): needs a Canvas in the scene.

    3 of 6: Health Bar UI, Screen Fader, Health Bar UI Pro

  • Uses TextMeshPro (the TMPro namespace) for text.

    3 of 6: Damage Popup, Tooltip System, Health Bar UI Pro

  • Calls DontDestroyOnLoad, so the object survives scene loads. Place it once, in your first scene.

    Applies to: Screen Fader

  • Reads the legacy Input Manager (UnityEngine.Input). If Project Settings > Player > Active Input Handling is set to Input System Package only, Unity throws an InvalidOperationException; set it to Both.

    Applies to: Tooltip System

Kits that build on them

Guides that use them