PCG C++ setting Bounds / Volume

Hi Everyone,

Does anyone know how to assign bounds to a PCG component through C++? I’ve been looking through the documentation and existing files, but can’t crack it.

For a bit of background - I am creating a fresh Actor class with spline comp as a root. Tested the graph itself in editor and all works well. In C++ I’m done with saving and loading the spline points and assigning the Graph and it all looks good, but produces no results. My guess is that it lacks the volume, where the generation should happen. I have tried adding a brush component as it’s there for the default class, but the brush component does not have the required Volume settings and my asumpion is, that the brush component is there simply as a helper and can be avoided if i manage the bounds through C++ and the PCG comp directly.

Thank You!

If anyone stumbles on this in future:

The volume is not required. Within PCG graph and spline component there is a “Track Actors Only Within Bounds”.

However - the real reason why i was running in to this problem was this:
As i mentioned - spline component was set as root through C++ and therefore - my Get Spline Data Actor filter was set to root. However - i got it working by changing the actor filter to “Self”.

So a short summary for anyone who want’s to know the essentials to create C++ Pcg class:

  1. You need to add “PCG” in YourProjectName.Build.Cs file in dependency modules
  2. Right click on YourProjectName.ueproject through file explorer and Generate visual studio files ( Not sure if it’s the same for VS Code )
  3. Main includes you will need : “PCGComponent.h” “Components/BrushComponent.h”

And if something is not working - pay extra attention, that PCG is getting the data input, that it needs

For ppl who know - it’s simple, but for beginners- this will come in handy

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.