Hey everyone I have a problem moving from UE 5.54 to 5.6:
I am generating a grid of points with PCG and route the points to the graph output like this:
Then I try to access the point data in a blueprint like this:
In UE 5.5 the Data port would give me PCGPointData and I then do Get Points.
In UE 5.6 the Data port gives me PCGPointArrayData and I don’t know how to get the points out of there :D.
Does anyone know what changed? And thank you so much if you have the time to look at my question.
I’m having kind of similar issue in which i use mesh sampler, i do get points according to mesh and triangles but they all spawn at center grid like at 0,0,0 location.
No matter what i do the pcg spawn at center of the grid, even if i move pcg or mesh the points don’t move.
Please do let me know if you have this kind of problem and if you solved it.
I’ve just come up against this today. First time trying to get point data into a BP so I’d assumed I was just doing something wrong. I can cast to PCGPointArrayData but stuck at that point. Any method of trying to cast to PCGPointData has failed.
(Edit: Can confirm the same setup I have is able to cast and get points in UE 5.5)
Hmm ok so something changed. I tried to contact Adrien Logut ( I think he is a developer on the PCG stuff at Epic) but so far no answer. I hope there is a new way to get at the point data in BP otherwise I can’t move to 5.6 right now.
Managed to do what I needed. In 5.6 the method is to create a PCG Blueprint Element. These basically let you create custom nodes for PCG.
Not saying this is the best way, but this is what I did:
In PCG graph: Get Actor Data > output and Actor Reference > renamed the attribute to ParentBPActor (pick your own name - this is so we can pass a reference in the next step to the BP that contains the current PCG graph instance
Create a new blueprint of class PCGBlueprintElement
Add an Actor Object Reference variable with the same name you used in the previous step and expose it.
In Class Defaults, enable Expose to Library
You can now add your PCGBlueprintElement as a node in your main PCG graph
Feed the attribute you made at the start into the nodes exposed attribute, and your point data into the main In input
Back in the PCG BP Element, from the Overrides drop down, implement Execute with Context
Now you can do whatever you want with the point data and the reference to the PCG owning Actor.
In my case, as everything I’m doing is editor only, not runtime, I implemented an interface in my main Actor that simply accepted thePCGData Collection , i.e. the point data. Then with my interface event I stored/set this in the main BP
During a PCG PostGenerateFunction (in the main BP Actor), I loop through the PCG Data Collection, break the array element so I can access Array Element Data, then Cast To PCGPointData