Scene Tree

Learn more about capturing scene tree data during errors and crashes. Sentry provides a visual representation of your game's scene tree at the time of failure, giving you additional insight into issues.

Sentry captures a JSON representation of engine's scene tree during errors and crashes, adding it to the event as an attachment. This feature is also known as View Hierarchy in Sentry.

Scene tree capturing is an opt-in feature. To attach scene tree information to your events, navigate to Project Settings > Sentry > Options and enable the Attach Scene Tree option:

Project Settings Screenshot

Or, like so, if you're configuring things programmatically:

Copied
extends SentryConfiguration

func _configure(options: SentryOptions):
	options.attach_scene_tree = true

Scene tree information is attached as view-hierarchy.json file. You can find it in the "Attachments" tab, where you can view all attachments, as well as associated events. Click the event ID to open the Issue Details page of that specific event.

Screenshots List Example

On the Issue Details page, you can interact with the scene tree attachment in a section called "Scene Tree". This section represents the state of your scene tree at the time of an error event. There are two displays: a tree view, and detailed view for a selected node. You can select nodes in the tree to view the properties collected by the SDK. The SDK will report on the following keys for each node in the view:

  • name: The name of the node.
  • class: Built-in class of the node.
  • script: The file path of the script attached to the node. Only nodes with a script attached include this property.
  • scene: The original scene's file path, if the node has been instantiated from a PackedScene file. Only scene root nodes include this property.

This feature provides a snapshot of your game's scene tree structure at the moment of error, making it easier to identify which nodes were active or gain a better understanding of the relationship between the nodes.

Scene Tree Example

Was this helpful?
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").