UI Toolkit Kit
Essential game UI components: health bars, damage numbers, tooltips, minimap, screen fader, and timer display.
6 scripts intermediate Starter kit Essential UI for any game
Download ui-toolkit-kit.zip 6 scripts and a README · 21 KB of C# · MIT
What is inside
- HealthBarUI.cs World-space or screen-space health bar with smooth fill, color gradient, and damage flash. Attach to enemies or use as HUD.
- DamagePopup.cs Floating damage numbers that animate upward and fade out. Supports critical hits, healing, and custom colors.
- TooltipSystem.cs Dynamic mouse-following tooltip that auto-positions to stay on screen. Supports rich text and custom layouts.
- ScreenFader.cs Simple screen fade-in/fade-out with configurable color and duration. Great for scene transitions.
- MinimapSystem.cs Render texture minimap with player icon, enemy blips, objective markers, and zoom control.
- Timer.cs Versatile timer with countdown, stopwatch, and repeating modes. Formatted time display and UnityEvent callbacks.
What it does
- Health bar with smooth fill, color gradient, and damage flash
- Floating damage and healing numbers with animations
- Mouse-following tooltip with auto-positioning and rich text
- Screen fade-in/fade-out for transitions and cutscenes
- Render texture minimap with icons and zoom control
- Versatile timer with countdown, stopwatch, and formatted display
Setup, in order
- Import all scripts into your project
- Create health bar UI with background and fill images
- Attach HealthBarUI and connect to HealthSystem events
- Set up tooltip panel with header and body TextMeshPro texts
- Create a full-screen Image for ScreenFader transitions
- Set up minimap camera and RawImage display for MinimapSystem
- Add Timer component for countdown/stopwatch displays
- DamagePopup.Create() for floating combat numbers
If something does not work
- The health bar does not fill
- HealthBarUI drives an Image's fillAmount. Set the fill Image's Image Type to Filled; on a Simple image, fillAmount has no visible effect.
- The minimap is black
- MinimapSystem shows a RenderTexture from a separate orthographic camera. Assign the same RenderTexture to that camera's Output Texture and to the RawImage, and make sure the minimap camera can see the layers you want.
- Tooltips are cut off at the screen edge or sized wrongly
- TooltipSystem flips to stay on screen and forces a layout rebuild for its ContentSizeFitter. Give the tooltip panel a ContentSizeFitter set to Preferred Size so it grows with its text.
- The kit is called UI Toolkit but uses Canvas
- The scripts are built on Unity UI (uGUI Canvas, Image and TextMeshPro), not the UI Toolkit (UXML) framework. Use them in a Canvas-based UI.
Preview
An excerpt of the kit's main types, and the Inspector fields they expose.
Inspector
Fields from the kit's preview excerpt; the full kit has more.
Fill Image None (Image)
Color Gradient None (Gradient)
Smooth Speed 5
Excerpt
C#
// HealthBarUI.cs - Smooth animated health bar
public class HealthBarUI : MonoBehaviour
{
[SerializeField] private Image fillImage;
[SerializeField] private Gradient colorGradient;
[SerializeField] private float smoothSpeed = 5f;
public void SetHealth(float current, float max) { /* smooth fill */ }
}
// TooltipSystem.cs - Mouse-following tooltip
public class TooltipSystem : MonoBehaviour
{
public static void Show(string header, string body) { /* ... */ }
public static void Hide() { /* ... */ }
// Auto-positions to stay on screen
}