A high-performance, allocation-free tween library for Unity that animates properties, delays and sequences with one line of code.
Cysharp/UniTask
Allocation-free async/await integration for Unity that makes Unity async operations, coroutines and PlayerLoop timing awaitable.
- Stars
- 11,256
- Forks
- 1,012
- Open issues
- 26
- Last commit
- 13 days ago
What is it?
UniTask is a Unity-specific task type and async/await integration. It provides a struct-based UniTask<T> with a custom async method builder aimed at zero allocation, as an alternative to the standard Task. Unity's AsyncOperations, coroutines and UnityWebRequest requests can be awaited directly, and frame-based waits such as Yield, Delay and DelayFrame replace common coroutine patterns.
The library runs entirely on Unity's PlayerLoop rather than threads, so it works on platforms such as WebGL and WASM. It also covers cancellation and timeouts through CancellationToken, MonoBehaviour message events and uGUI events as awaitable or async-enumerable streams, and asynchronous LINQ with Channel and AsyncReactiveProperty. A TaskTracker editor window helps locate leaked tasks.
UniTask requires Unity 2018.3 or newer with C# 7.0 task-like builder support, and can be installed through UPM via git URL or from a unitypackage release.
Key features
- 01Struct-based UniTask<T> with a custom async builder designed for zero allocation.
- 02Direct await support for AsyncOperation, UnityWebRequest and IEnumerator coroutines.
- 03PlayerLoop-based Yield, Delay and DelayFrame replace common coroutine waits.
- 04Runs on PlayerLoop without threads, so it works on WebGL and WASM.
- 05CancellationToken, timeout helpers and a TaskTracker editor window for debugging leaks.
- 06Asynchronous LINQ, Channel and AsyncReactiveProperty for async streams.
Use cases
- Replacing coroutines in a Unity game with async/await code.
- Loading assets or scenes and making web requests in sequence or in parallel inside Unity.
- Building Unity projects that target WebGL, where threads are unavailable.
- Converting uGUI button clicks or MonoBehaviour events into awaitable async streams.
Topics
FAQ
- What is UniTask?
- Allocation-free async/await integration for Unity that makes Unity async operations, coroutines and PlayerLoop timing awaitable. UniTask is a Unity-specific task type and async/await integration. It provides a struct-based UniTask<T> with a custom async method builder aimed at zero allocation, as an alternative to the standard Task. Unity's AsyncOperations, coroutines and UnityWebRequest requests can be awaited directly, and frame-based waits such as Yield, Delay and DelayFrame replace common coroutine patterns.
- Is UniTask free to use? What license does it have?
- UniTask is open source under the MIT license. Check the license terms before using it in commercial products.
- Is UniTask still maintained?
- Actively maintained. The last commit to UniTask was on Oct 6, 2026.
- What can I use UniTask for?
- Replacing coroutines in a Unity game with async/await code. Loading assets or scenes and making web requests in sequence or in parallel inside Unity. Building Unity projects that target WebGL, where threads are unavailable. Converting uGUI button clicks or MonoBehaviour events into awaitable async streams.
- Where can I get UniTask?
- The source code and installation instructions are on GitHub: https://github.com/Cysharp/UniTask
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
Official Unity integration for Yarn Spinner, a screenplay-style dialogue system for running conversations in games.
Unity Editor and runtime plugin that lets AI agents like Claude, Cursor and Copilot control Unity via MCP tools and generated skills.
A uGUI-based in-game console for Unity that shows runtime logs and lets you run registered debug commands in builds.
A Claude Code template that sets up 49 specialized AI agents, 74 slash-command skills and coordination hooks to run a game project like a studio.
A Unity extension that generates 2D navigation meshes from tilemaps, sprites and Collider2D shapes for pathfinding in top-down games.