# Debug Context

Level: Beginner

## Goal

Set Debug Context to the scene object that owns the graph runtime so the editor can resolve Blackboard paths, runtime previews, and visual debugging records against the correct object.

## When To Use This

Use Debug Context whenever a graph asset is opened in the Graph Editor and the graph depends on scene data. This includes Local Blackboard reads, Scene Blackboard reads, runtime summaries, visual debugging highlights, and any workflow where one graph asset may be assigned to more than one `FlowCoreProcess`.

Debug Context changes the editor's preview context. It does not change the graph asset, move Blackboard values, or execute the graph.

## Prerequisites

* A scene GameObject has a `FlowCoreProcess`.
* The process has a graph assigned or an embedded graph.
* Required Local or Scene Blackboards are bound in the process Inspector.

## Where To Find It

Open the Flow Graph editor and look in the editor header for **Debug Context**. The field should point to the GameObject that owns the `FlowCoreProcess` you want to inspect.

## Workflow

1. Select the runtime owner.
   * In the Hierarchy, find the GameObject with the `FlowCoreProcess`.
   * Confirm the process is the one using the graph you are editing.
2. Check the process bindings.
   * Confirm the graph asset is assigned.
   * Confirm `Local Blackboards` contains the Local Blackboard used by the graph.
   * Confirm Scene Blackboard references are explicit when the scene has more than one candidate.
3. Set Debug Context.
   * Open the graph in the Flow Graph editor.
   * Set **Debug Context** to the GameObject with the `FlowCoreProcess`.
   * If the same graph asset is used by another GameObject, switch Debug Context before inspecting that other instance.
4. Turn on useful detail.
   * Keep `Summary` on to see compact path information.
   * Keep `Value` on while verifying Blackboard bindings.
   * Use `Comment` when you need design intent next to the node.
5. Read the summaries before Play Mode.
   * A Local Blackboard value should resolve against the selected process context.
   * Missing keys, wrong types, and unbound scopes should be visible as unresolved or suspicious summaries.
   * Fix unresolved paths before testing runtime behavior.
6. Use the same context during Play Mode.
   * Enter Play Mode with the same scene object selected as Debug Context.
   * Visual debugging records are filtered through the selected process.
   * If no highlights appear, confirm the selected context is the process that actually ran.

## What Changes

Debug Context only changes editor interpretation:

* Summaries can resolve Local and Scene Blackboard paths.
* Value previews can use the selected process bindings.
* Visual debugging can show records for the selected runtime process.
* The graph asset stays shared and unchanged.
* Runtime data is not copied, written, or reset by selecting a Debug Context.

## Verify the Result

Use the visual Hello World graph as a quick check:

1. Select the GameObject with `FlowCoreProcess` and `Blackboard`.
2. Set Debug Context to that GameObject.
3. Select the `Action` node that runs `Log String`.
4. Confirm the value path resolves to the Local Blackboard key `Say`.
5. Enter Play Mode and confirm the Console prints `Hello Flow Core`.

If the Console result is correct but the editor preview is unresolved, the graph can still run, but the editor is not inspecting the same context you tested.

## Common Mistakes

* Selecting the graph asset instead of the scene GameObject that owns the process.
* Leaving Debug Context on an old object after changing scenes.
* Inspecting a shared graph asset through the wrong instance.
* Forgetting to add the Local Blackboard to `Local Blackboards`.
* Expecting Debug Context to create or repair Blackboard keys.
* Turning off `Summary` or `Value` and then missing the unresolved path hint.

## Troubleshooting

* Summaries show unresolved Local data: check the process `Local Blackboards` list and the Blackboard index used by the node.
* Summaries show the wrong value: confirm Debug Context is not pointing at another instance of the same graph.
* Visual debugging is empty in Play Mode: confirm the selected process is enabled and is the process that received the trigger or Entry call.
* Scene Blackboard data is ambiguous: bind the intended Scene Blackboard explicitly.

## Related

* [Graph Debugging](/flow-core-docs/documentation/troubleshooting/graph-debugging.md)
* [First 15 Minutes](/flow-core-docs/documentation/tutorials/first-15-minutes.md)
* [Blackboard UI](/flow-core-docs/documentation/editor-guide/blackboard-ui.md)
* [Detail Level Toggles](/flow-core-docs/documentation/editor-guide/detail-level-toggles.md)
* [Lifecycle and Dataflow](/flow-core-docs/documentation/runtime-guide/lifecycle-and-dataflow.md)
* [Beginner Glossary](/flow-core-docs/documentation/reference/glossary.md)


---

# Agent Instructions: 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://flow-core.gitbook.io/flow-core-docs/documentation/editor-guide/debug-context.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.
