# BehaviorPreset

A **BehaviorPreset** is a `ScriptableObject` that stores the full configuration for a behavior — goal stacks, initial states, world state categories, and actions. Multiple behavior GameObjects can reference the same preset.

***

## Why Use a Preset?

* Reuse identical behavior configurations across many GameObjects without duplicating Inspector data
* Configure behaviors once in the Project window; all instances pick up changes automatically
* Useful for enemy types, worker units, or any behavior that shares the same behaviour profile

***

## How It Works

When an AIBehavior has an `_behaviorPreset` assigned:

* On `Awake()`, the preset's goal stacks, states, categories, and actions replace the AIBehavior's Inspector lists
* Each action is **cloned** (`Action.Clone()`) so every behavior instance has isolated runtime state — there is no shared mutable state between behaviors using the same preset

***

## Scene Targets with Presets

ScriptableObjects cannot hold scene Transform references. Use **TargetBinder** components on scene objects instead — they self-register with `TargetBinderRegistry` at runtime and are automatically queried by `ResolveTarget()` during planning. No manual per-behavior binding is needed.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://beelabs-dev.gitbook.io/beelabs-docs/goap-engine/behavior-preset.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
