Goal

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 timeout wait has succeeded and Return Success is running beside the long-running action.

Here Wait for Timeout has completed, so Return Success ends the parallel race and stops Long Running Action.

Variations

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 in this tree

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