Building a System with the Scene Graph: A Modular Pickup
Building a System with the Scene Graph: A Modular Pickup
You've got the pieces now. Entities and components (Part 2). Hierarchy and transforms (Part 3). Let's assemble them into one small, complete, modular system: a collectible pickup.
Here's the behavior we want:
- A glowing object sits in the world.
- A player walks up and presses the interact button.
- On a successful interaction, the object's light snaps off and its shape vanishes — it's been collected.
The word that matters is modular: we'll write one component that works on any entity with the right parts, no matter how that entity is arranged. That's the Scene Graph way.
Step 1: Picture the entity tree
<!-- section-art:step-1-picture-the-entity-tree -->

Hierarchical Hierarchy
First, the shape of the thing — in the editor, not in code. Following the Part 1 rule (one component of each kind per entity), a glowing, grabbable pickup is naturally two entities in a small hierarchy:
Pickup (parent entity)
├── mesh_component ← the visible shape
├── interactable_component ← "press to grab"
└── Glow (child entity)
└── light_component ← the glow
The glow lives on its own child entity so it can have its own light_component (the parent already could too, but separating it keeps things tidy and shows off the hierarchy). From Part 3 you know the consequence: move the Pickup and the Glow rides along, because it's a child.
We'll bolt our custom component onto the Pickup parent. Its job: wait for an interaction, then turn the whole pickup — light included — off.
Step 2: Find the pieces, don't hard-code them
The modular trick is that our component doesn't assume an exact layout. Instead it searches for the parts it needs, using the query verbs. The key one here is FindDescendantComponents — "find every component of this type anywhere below me in the tree." That's how a component on the parent reaches the light_component sitting on its child.
Here's the real pattern, straight from Epic's lantern sample, for grabbing every light under an entity and switching it:
# Turn off every light_component nested under this entity.
for:
Light : Entity.FindDescendantComponents(light_component)
do:
Light.Disable()
Read it: "for each light found below me, disable it." Because it searches descendants, it doesn't matter if there's one glow or ten, on this entity or three levels down — they all get switched. That's modularity: the code adapts to the structure instead of demanding one exact structure.
Step 3: Listen for the interaction
Now, when do we do the switching? When a player finishes interacting. An interactable_component fires a SucceededEvent the moment an interaction completes successfully. We subscribe a function to it — same .Subscribe(...) move you met in The Grammar of Verse, and exactly how Epic's own sample wires it up:
# Find the interactable components below us and listen to each one.
Interactables := Entity.FindDescendantComponents(interactable_component)
for (Interactable : Interactables):
Interactable.SucceededEvent.Subscribe(OnCollected)
SucceededEvent is a listenable — a thing you can .Subscribe a function to. When the interaction succeeds, the Scene Graph runs our OnCollected function and hands it the player (the agent) who did it.
Step 4: The complete component
Put it together and here's the whole modular pickup. Read it top to bottom — every line is a sentence you can now parse:
Let's walk the two methods:
OnBeginSimulation(a lifetime method from Part 2) — at startup, we call the base version with(super:)OnBeginSimulation(), then useFindDescendantComponents(interactable_component)to gather every interactable below us and.Subscribe(OnCollected)each one'sSucceededEvent. Now we're listening.OnCollected(Collector:agent)— runs on a successful grab. It takes theagent(the player) as a parameter — handy if later you want to give them points. Inside, thefor ... do:loop disables every light below us, and the guardedif (Mesh := Entity.GetComponent[mesh_component])disables the mesh on the pickup itself. Square brackets onGetComponent[...]because it might fail, exactly as in Part 2.
The pickup is now invisible and dark — collected — without ever being deleted. (Disabling rather than deleting means you could re-enable it later for a respawn, by calling Enable() instead.)
Step 5: Why this is genuinely modular
Look at what this component doesn't hard-code:
- It doesn't name a specific light. It finds all of them with
FindDescendantComponents. One glow or five — same code. - It doesn't assume the interactable is on a particular entity. It finds every interactable below it and listens to all of them.
- It works on any pickup with this rough shape. Drop the component on a glowing coin, a health pack, a key — all of them collect correctly.
That's the heart of Scene Graph design from the docs: "this also means your component can require less setup because all you have to do is add your Verse component and have the correct entity structure." You write the behavior once; you reuse it by arranging entities, not by copying code. Wrap the whole pickup as a prefab (a reusable template) and you can stamp out a hundred collectibles across your island, every one wired and working.
Step 6: Stretch it (try these)
<!-- section-art:step-6-stretch-it-try-these -->

Respawning Orb
- Give the player something.
OnCollectedalready receivesCollector:agent. Award points or play a sound for that player when they grab the pickup. - Make it respawn. Instead of leaving it disabled, in
OnCollectedSleep(5.0)then re-Enable()the mesh and lights — a collectible that comes back. - Make it bob. Add the
rising_platform_componentidea from Part 3: a loop inOnSimulatethat nudges the local transform up and down so the pickup floats invitingly.
Each of those is a small change because the structure is sound. That's the reward for learning the model instead of memorizing one snippet.
Why this helps you boss around an AI
You can now hand a helper a real spec: "Write a class<final_super>(component) that, in OnBeginSimulation, finds every interactable_component with FindDescendantComponents and subscribes its SucceededEvent; in the handler, disable all descendant light_components and the entity's mesh_component." That's a buildable sentence end to end — every noun and verb is real. The whole point of this series is that you can now write that sentence.
Quick recap
- A working system is entities arranged in a tree with components bolted on — built in the editor, driven by Verse.
- Make it modular by finding parts with
FindDescendantComponents(...)instead of hard-coding them. - Wire behavior to interactions by subscribing to an
interactable_component'sSucceededEvent. - Switch things on and off with
Enable()/Disable()instead of deleting — reversible, respawn-friendly. - Reuse the whole thing as a prefab: write the behavior once, stamp it everywhere.
That's the series. You've gone from "what even is a scene graph" to building a reusable, event-driven system entirely out of real Scene Graph APIs. For the language fundamentals underneath it all, revisit The Grammar of Verse — the two series are meant to be read side by side.
References
Get the complete code — free
You've read the full walkthrough. The complete, copy-paste-ready Verse solution is free for members — sign in to unlock it.
Free with your BrainDead.TV / BrainDeadGuild Discord account. The walkthrough above is always free.
Verse source files
- 01-fragment.verse · fragment
- 02-fragment.verse · fragment
- 03-standalone.verse · standalone
Check your understanding
Test yourself with an interactive quiz and track your progress + earn XP — free for members.
Turn this into a guided course
Add Verse Scene Graph — a complete worked example tying entities, components, hierarchy, and transforms together to your free study plan — we'll suggest related pages and stitch the lot into one compile-checked, self-guided lesson with worked examples and quizzes.
References
Original tutorial generated by Verse Island from the Verse/UEFN knowledge base, with references to the Epic Games sources above. Code is validated against the knowledge base.