ClosureBT - Code Based Behavior Tree Via Composition OFFICIAL SALE

[Website] [Discord] [Documentation]


ClosureBT is a behavior tree and state machine framework for Unity that uses C# function closures paired with an embedded DSL instead of visual node editors or blackboard systems. This allows for far more flexibility and ease of integration compared to traditional visual based behavior trees. Please visit the website for more in depth explanations / code samples of included features.


Embedded Domain Specific Language

  • Composition based API inspired by React Hooks

Time Travel Debugger

  • Scrub through execution history
  • Variables values are saved per snapshot, let's you see your variables at specific points.

Allocation free async/await through UniTask and an allocation free runtime core

  • Nodes have OnEnter, OnExit, OnSuccess, etc with async overloads.
  • Closures are created once only and cached, resulting in allocation free execution.

Functional Reactive Programming Support

  • Optional support for FRP style variables

Parameterized nodes with return value support

  • Nodes can have parameters and return values, allowing for improved modularity and configurability.

Runtime node insertion and recursion support

  • Nodes can insert nodes, including themselves! This allows for patterns like for example dependency chain resolution (eg "Craft" item resolves gathering items, building crafting bench, etc).
  • Easily swap behaviors based on conditions

Requires UniTask (free, with installation helper included).