Use a timeout when a long-running task must stop after a fixed limit.

Tree structure

A Parallel Selector runs a long action beside a timeout branch.

How it runs

Create a Parallel Selector with the Action to limit as one child. Add a Sequence as the other child, then place Wait for Timeout and Return Success under that Sequence. Set Wait to the allowed duration. The structural tasks are built in; Long Running Action represents the game-specific Action being limited.

Both branches start together. If the Action succeeds first, the Parallel Selector succeeds and stops the timer. If Wait finishes first, its branch succeeds and the Parallel Selector stops the Action.

The completed timeout branch and Parallel Selector show Success, while the stopped Long Running Action shows Failure.

After Wait for Timeout completes, Return Success finishes its Sequence. The Parallel Selector succeeds and stops Long Running Action, which shows Failure in this paused, completed example.

If timing out should count as Failure, put a Return Failure decorator above the timer branch and use a Parallel or an explicit Perform Interruption branch. Decide whether the timeout is a successful fallback or an error that a parent should handle.

Tasks used:

Parallel Selector, Wait and Return Status in the Actions reference, and Perform Interruption.