Spawn PCG point on a wall.

Hi there! As the title said, I’m stuggling for a real method to sample walls in a proper way.
I was using ray hit query, but works only for the world space, so it’s pretty useful from top to bottom but useless in x and y axis.
I want to control the density of a sample using its distance from a wall.
For now I’ve found a solution using intersect with tagged actor geometry, but you have to put tags on the meshes (that can be useful in a certain way) and I’m not able to get the point outside the mesh, just inside, and this create some weirdness in some points.

How can I cast from a volume to get points only in vertical, along x and y axis?
Every hint and solution could be very useful! Thanks!

Hello @AFedeleallalinea11

I just briefly experimented with the ‘Ray Hit Query’ node and did not get the results I expected. (Setting Ray direction X axis to 1 did not place any points on the wall infront of me on the X axis)

Consider asking this in this thread or on todays livestream.

Hi! I’ve missed the livestream. Yes, ray hit query is a world position node, so you can just set 1 origin that also is not parametric, so you cannot neither fix it trough blueprints.
For now, the best solution for me (but a little clumsy) was using “intersect with tagged actors geometry”, but you have to put the tag manually in every geometry you want to be intersected. Is not bad, but the result is not exactly the one I wanted.

Hi @AFedeleallalinea11
I’m currently tackling the same Problem.
Have you found a solution for this?
If not can you explain a bit how you filtered the outer most layer from “intersect with tagged actors geometry”?

Hey, I found this method to sample meshes:
Each object must be a blueprint. It must be tagged and have a construction script that will store its Static Mesh into variable (‘Static Mesh’ in my case)
It also needs PCG component with script like this:


Here I use MeshSampler to get the points. I’m actually getting two sets of points. One for the surface with OnePointPerVertex/Triangle method and for the insides PoissonSampling

On the image is also the main generator and how I access the data.

With this method I’m able to get quite reliably points on any arbitrary mesh and what was the most important to me I can get normals information from those meshes or whatever data I want to generate in the per object PCG graph.

The only downside I didn’t figure out yet is that this one pair of GetActorData nodes can access only one mesh. If I want to use another, differently looking it won’t work :frowning:
But maybe there is a way how to split the incoming data into groups and Copy them separately.

Hope it will help.

Hi, thanks for your response.
Your solutions works great.
In case you need a more generalized version i got something similar.


Unbenannt1

For the “Volume Sampler” it’s important that your tagged mesh also uses collision.

I use some landscape points that can be offseted in z to filter my desired area from the points on the mesh with a distance to these points.

In my case the “Volume Sampler” spawns the points only on the mesh surface, but if i take a basic shape the whole mesh volume is filled with points. :face_with_raised_eyebrow:
Hope that helps.

1 Like

Trying to find my way into working with PCG objects and while I’m really happy with the results on the floor everything vertically won’t work! Found this thread and now I’m curious if there are some more straight-forward solutions to that problem since June 2023?