# How to Affect the PCG in Runtime with Blueprint

**URL:** <https://forums.unrealengine.com/t/how-to-affect-the-pcg-in-runtime-with-blueprint/1146953>\
**Category:** Blueprint\
**Tags:** unreal-engine, editor, Blueprint, question\
**Created:** [April 28, 2023, 3:29am UTC](https://forums.unrealengine.com/t/how-to-affect-the-pcg-in-runtime-with-blueprint/1146953 "2023-04-28T03:29:46Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![patrickzw](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@patrickzw](https://forums.unrealengine.com/u/patrickzw)\
**Post date:** [May 8, 2023, 2:30am UTC](https://forums.unrealengine.com/t/how-to-affect-the-pcg-in-runtime-with-blueprint/1146953/7 "2023-05-08T02:30:23Z")

</div>

I just found a workaround.

I created two PCG graphs with the same node, but the static mesh is different in the spawn static mesh node.

I named the two PCG graphs “PCG\_Sphere” and “PCG\_Cube” with these nodes.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/2/2/322836379a7937536eff3cc61f5f35612a2f40d9.png)

Then I create an Actor containing a door static mesh and box collision and the code will be this:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/e/b/3eb68b8d69534cd8c1e6c7c610723de2724f2b40.png)

So when I collide with the door, it will change the graph of the PCG volume in the level and then set it back when I end up overlapping with the door.

Here is the result:

[https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/4/1/a410866be8ed43a06c6a5170f4a45554d1941282.mp4](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/4/1/a410866be8ed43a06c6a5170f4a45554d1941282.mp4)

---

_[View the full topic](https://forums.unrealengine.com/t/how-to-affect-the-pcg-in-runtime-with-blueprint/1146953)._
