PCG Get Actor Data Destroys Everything On Play

I have a PCG graph in a Blueprint that is set up to Generate on Demand. I can then click Generate when I need to in the editor. Doing so, will cause it to create a set of ISMs as components of the Blueprint, which is exactly what I want. When I click Play, the ISMs remain as components of the Blueprint and I can do further logic on them during play. This is the behavior I want.

But then I needed to reference some tagged meshes in the level, so I added the Get Actor Data node to the PCG graph. This node lets you get points for any actors and such with a specified tag. Works great, except for one big problem. As soon as I click Play now, the ISMs are all automatically destroyed. So, everything that the PCG graph generated in the editor at design time just disappears as soon as I click Play. When I click Stop, it all comes back and reappears. The issue is that PCG is automatically deleting the ISMs for some reason. This only happens when using the Get Actor Data node. If I get rid of that single node, the problem goes away and everything works fine.

So, I guess my questions are, does anyone know why Get Actor Data does this and can I stop it doing this somehow?

I’m aware of the Clear PCGLink button on the PCG graph component. The problem with this button though is it creates a separate “stamp” actor of the ISM components. I need the ISM components to be inside the Blueprint with the PCG graph so I can do further logic with them during play.

After further investigation the issue occurs when using both the Get Landscape Data and the Get Actor Data in the same PCG graph. If either of these nodes are removed from the graph then everything works fine. But if both nodes exist anywhere in the graph (even if they don’t interact with each other) then PCG will destroy everything and fail to generate when clicking Play. I’ve tested this in both 5.6 and 5.7 now. Does anyone know what is going on and why? Can anyone else verify this happens for them too?

So, for anyone else that stumbles upon this problem in the future, I found the only two solutions is either to duplicate all of the ISMs and delete the PCG linked ones. To do this, you need to write some C++ as you can’t do it properly in Blueprint alone. Alternatively, you can just delete the PCG graph and it unlinks the ISMs. In Begin Play, just call Destroy Component on the PCG component, which solves the problem. This is assuming you are not using any runtime generation and only need in-editor generation.