Does PCG feature support in runtime mode?

Hi, I just start learning PCG,
(have some experience in HE though)

I’ve searched the topic about it,
only found these two threads that has a resolved answer,
one says the PCG’s not available in runtime at the moment:

the other provides a walkaround to update the PCG graph in game:

I tried testing PCG in-game by adding a slider to control the random seed,
it works in the PIE viewport, but doesn’t respond in an compiled exe program at all.

Anyone successfully ran the PCG in your games ?

Thanks in advance:]

I don’t know how you interpreted my comment to “PCG doesn’t work at runtime”. It does work at runtime, but you can’t rely on editor callbacks.

If something change at runtime and you want to update your component, you need to call “Generate” with Force = true on the PCG Component in BP.

Is anyone else not having luck with this? I tried making a BP and adding the PCG component to it. The PCG graph is simple it just takes a point and spawns a sphere mesh on it. I setup keyboard inputs in the BP so that 8 takes the PCG component and does Cleanup, and then 9 does Generate. I set the generation trigger to Generate on Demand. When I test this in game and hit 8, the pcg component will cleanup correctly, but then when I hit 9 it wont generate again. Am I missing something on the steps? Can’t seem to find a way to get it to generate in game, and I know that’s accessing the component correctly because cleanup is working. I have generate on demand checked in the BP not sure what else would be the issue.

1 Like

Hi,

Ever figured it out? Having the same issue.

Hi!

I encountered the same issue and it has been bothering me for nearly a week. I searched extensively on Google and YouTube but found no solution. Fortunately, I stumbled upon the problem’s cause unintentionally.

It seems that the PCGComponent requires a BrushComponent to work at runtime. Strangely, it appears to function without a BrushComponent in the Editor. Additionally, the BrushComponent is not searchable under the “Add” menu. Consequently, my workaround was to use “Get Actor By Class” to obtain the PCGVolume and achieve the desired effect.

I hope this helps you out.

1 Like

Can you please explain how you used “GetActorByClass”?

It seems very weird that something specific like a brush component would be needed.