I’m new to Bolt. I’m trying to make a simple script on a prefab that turns on some screens on a computer console when the player interacts with it. The screens are a separate prefab in the console prefab, and I made a game object variable that references them. Here I’m trying to disable them on start. If I delete the Get Variable node so the Set Active node references Self, it works fine and disables the entire prefab, so the problem seems to be in the Game Object variable.
Is there a better way to reference parts of the prefab in the flow graph?



Prefab is a concept that exists only in the editor. When you start the game, the prefab becomes a regular gameobject. So you can’t reference the Prefab from the Project window, you have to reference the GameObject from Hierarchy window, which is where it exists at runtime.
“This” reference works because it references itself from Hierarchy.
Weird. It will let me drag it from the Project window to the Flow Graph or the Blackboard, but it won’t let me drag it from the Hierarchy. Or I can add it to the variable with the drop down on the Blackboard, but that’s also referencing the prefab. You’re obviously right, because every time I run the scene it disables the prefab in the Project window, but not in the scene.
How do I reference the game object in the hierarchy?
In this case, you’re using “Graph” scope variables, which in an asset graph won’t let you reference GameObjects from Hierarchy.
So you have several ways of working around this.
- An embed graph as opposed to an asset graph can reference GameObjects straight from the Hierarchy with any variable scope (including Graph variables) or literal GameObject references - drag and drop a GameObject in an embed graph and it’s referenced.
- Another way would be by using Object scope variables which can access GameObjects in Hierachy for any graph type assuming the GO the graph asset is on exists in Hierarchy at edit time.
- The GameObject you want to reference can Set itself as a Scene or Application variable in On Enable or On Start which then can be referenced in any other graph.
Thanks! Changed to an embed graph and everything just worked.