To project PCG Spline Data to static Mesh ?

Is there any way in which we can project spline data to static mesh rather than input (Landscape) in PCG ? The problem I am that when we Spawn grass with the help of spline PCG on a landscape It can easily detect the surface and project on the exact surface but when we use the same method to static Mesh Surface then we have to manually place the spline on the surface on a static mesh to have perfectly grounded grass. Is there any way to do it?

This should help you :wink:

The short answer is to use the World Ray Hit Query node.

No. He means controlling the projection area on the mesh through the spline. As in, we don’t want to project on the whole mesh, but just on a part of it.
Or, another explanation: The spline is used to spawn stuff only in a certain well defined area on the landscape, right? Well, how can we apply the same concept, but on a mesh instead.
Or, is there a better way to achieve this?

did you solve your problem? faced similar and looking for solution…

Nope. I’ve put it aside, for now, until they update this functionality, hopefully.

What is the point in the Bounding Shape input for the Surface Sampler node if not to do exactly this?

Isn’t this how it ought to work? I’ve tried everything I can think of but cannot get a Spline to mask out the results of the World Hit Query node :frowning:

Update, this is working with a texture object, but not a spline (and I really need it to work with the latter)

Has anyone figured out if this is possible? for example, in the latest version of unreal 5.5

This is possible by using a World Ray Hit Query in a Projection node. Set up your system using a spline, and place the two nodes just before spawning your instances.

For the World Ray Hit Query to work, you’ll need to create a specific tag for each static mesh that should receive the projection. Then, in the Filtering tab of the node, set the “Actor Tag Filter” to “Included Tagged” and enter the name of your tag.

This should do the trick, but be careful with your collisions—the World Ray Hit Query projects based on the collision mesh, not the actual geometry. To ensure accuracy, go to the mesh settings, search for “Collision Complexity” and set it to “Use Complex Collision as Simple”.

And if you want to project onto more than one axis, you can duplicate the two nodes, set the Ray Direction to a different value, and then merge the points from both Projection nodes. The picture below shows this example.