GitPedia
Inspiaaa

Inspiaaa/UnityHFSM

A fast, tried-and-tested hierarchical finite state machine library for Unity, designed to be easy to use yet powerful without compromising performance.

10 Releases
Latest: 2mo ago
2.3 QoLv2.3.0Latest
InspiaaaInspiaaa·2mo ago·March 23, 2026
GitHub

📋 Changes

  • Dynamic Logic Control: You are no longer "locked in" after setup. Core properties — including `needsExitTime`, `forceInstantly`, `isGhostState`, and `isExitTransition` — can now be modified at runtime, allowing your states to adapt their behaviour on the fly.
  • Action Introspection: The new `HasAction` method lets you check if the current active state hierarchy has defined an action for the specified trigger. This is perfect for implementing "fallback" logic (like a "click" sound when an ability is unavailable) without cluttered logic.
  • Enhanced Stability: We've addressed an import crash for Unity 6 users and further optimised the `StateMachine` class to ensure your game remains as performant as possible.
2.2.1 Patchv2.2.1
InspiaaaInspiaaa·4mo ago·January 29, 2026
GitHub

In a time of ever-increasing RAM prices, you’ll be delighted to hear that we’ve **fixed a critical memory leak** in the new Animator Graph visualisation feature. Additionally, we've resolved a synchronisation issue that could trigger internal consistency errors in the Unity Editor. Special thanks to @sandsalamand for the contribution.

2.2.0 Feature Releasev2.2.0
InspiaaaInspiaaa·1y ago·March 29, 2025
GitHub

🐛 🛠️ Animator Graph Visualisation Tool: Clearer Insights, Better Debugging

  • ![Animator Graph Example](https://github.com/Inspiaaa/UnityHFSM/blob/master/docs/Images/AnimatorGraphExample.png)

📦 🧹 Polishing the Details

  • This release also focuses on making UnityHFSM cleaner and more reliable:
  • Internal refactoring to make the codebase easier to maintain and to extend.
  • Improved naming of classes and interfaces to make development even more straightforward.
  • A collection of small features, bug fixes, and improved documentation straight in your IDE.

⚡ Performance Boosts: Smoother and Faster

  • Performance is a top priority, and this release brings some significant speed improvements:
  • Direct transitions are 20% faster when the source state needs exit time.
  • Delayed transitions are now up to 60% faster.
  • ---
  • For more information on this release and on the latest compatibility-breaking changes, please see the [changelog](https://github.com/Inspiaaa/UnityHFSM/blob/master/Changelog.md).
  • ---
  • With UnityHFSM v2.2, the library is more powerful, efficient, and user-friendly than ever. Thanks for using UnityHFSM, and I look forward to seeing what you build with it! 🙌
2.1.0 Feature Releasev2.1.0
InspiaaaInspiaaa·2y ago·May 28, 2024
GitHub

Version 2.1 of UnityHFSM adds exciting new features, while once again improving performance. With the new `ParallelStates` class, you can effortlessly run multiple sub-states / state machines in parallel. At the same time, the new `StateChanged` event and the `rememberLastState` feature make (hierarchical) state machines more powerful and flexible to your use cases than ever before. If you're working with complex, large state machines, these are up to 15% faster now thanks to general optimisations. Bugs have been fixed, naming improved, and new documentation has been written. For more information on the latest changes, please see the [changelog](https://github.com/Inspiaaa/UnityHFSM/blob/master/Changelog.md).

2.0.1v2.0.1
InspiaaaInspiaaa·2y ago·November 15, 2023
GitHub

This release fixes the sample code which did not compile after the recent 2.0.0 release. It also reintroduces the `timer` field in the `CoState` class which was lost in the previous release. If you are migrating from a pre-2.0 version, please see the [changelog](https://github.com/Inspiaaa/UnityHFSM/blob/master/Changelog.md), as the 2.0 release includes compatibility-breaking changes.

2.0.0 Feature Releasev2.0.0
InspiaaaInspiaaa·2y ago·September 17, 2023
GitHub

Version 2.0.0 comes with exciting new features such as **ghost states**, **transition callbacks** and **exit transitions**. Exit transitions finally provide an easy and powerful way to define the exit conditions for nested state machines, essentially levelling up the mechanics behind **hierarchical state machines**. At the same time, **debugging** complex hierarchical state machines has never been easier thanks to the new `GetActiveHierarchyPath()` method. In addition, the latest release comes with **many improvements** to existing features, such as the support for coroutines, the `canExit` mechanics, and the `HybridStateMachine` class, while also fixing numerous bugs related to delayed transitions. Thanks to refactorings, the internal code is easier to read and maintain. Please see the [changelog](https://github.com/Inspiaaa/UnityHFSM/blob/master/Changelog.md) when migrating to the latest version, as it includes compatibility-breaking changes.

1.9.0 Action Systemv1.9.0
InspiaaaInspiaaa·3y ago·August 4, 2022
GitHub

Version 1.9.0 of UnityHFSM introduces the **action system** which allows you to define custom events (like `OnLogic`) that can call functions in the active states. This release also adds "**two way transitions**" which can greatly reduce the amount of boilerplate code required in many cases. Furthermore **performance** has been increased when using value types as the state names (e.g. `State<int>`). 👍 Read more: [Changelog](https://github.com/Inspiaaa/UnityHFSM/blob/master/Changelog.md)

1.8.0 Genericsv1.8.0
InspiaaaInspiaaa·4y ago·August 1, 2021
GitHub

Version 1.8 of UnityHFSM adds support for generics. Now the datatype of state identifiers / names and the type of event names can be easily changed. Thanks to the new "shortcut methods", state machines can be written with less boilerplate than ever and certain cases, such as empty states, can be optimised automatically for you. 👍 1.8 also adds support for installation via Unity's package manager UPM. Read more: [Changelog](https://github.com/Inspiaaa/UnityHFSM/blob/master/Changelog.md)

1.7.2v1.7.2
InspiaaaInspiaaa·5y ago·May 25, 2021
GitHub

:sparkles: 1.7.2 let's you activate triggers that can propagate down the hierarchy to the active sub-states. :+1:

1.7.1v1.7.1
InspiaaaInspiaaa·5y ago·May 24, 2021
GitHub

✨ Version 1.7 introduces Trigger Transitions which let you effortlessly leverage the efficiency of event-based transitions, in combination with the full power of the existing high-level transition types. 👍 The error messages have been greatly improved in 1.7.1, so that they are concise and helpful.