Hello everyone,
I’m working on a project in Unreal Engine 5 where I’m using the Procedural Content Generation (PCG) system to populate a spline’s interior with 100x100 floor meshes and place walls along its edges. However, I’m running into an issue with the Spline Sampler in Interior mode, and I could use some help figuring out what’s going wrong.
What I’ve Done:
Spline Setup:
I created a spline in a Blueprint Actor and set it to Linear mode with a Closed Loop.
I used the “Make Cube” option to generate a cube-shaped spline automatically.
The spline’s size is set to 10,000 units (so it’s quite large).
PCG Graph Setup :
I added a Get Spline Data node to retrieve the spline’s data.
I connected it to a Spline Sampler node with the following settings:
Dimension: On Interior (to fill the spline’s interior area).
Interior Sample Spacing: 100 units (to match my 100x100 floor mesh).
Interior Border Sample Spacing: 100 units (initially, but I later changed it to 50 for better visualization in the debug mode).
I enabled Debug Mode to visualize the points generated by the Spline Sampler.
I added a Static Mesh Spawner node to place my 100x100 floor mesh at the generated points.
The Issue:
When I run the PCG graph, the debug points (and the spawned floor meshes) are placed in completely incorrect locations. They don’t align with the spline’s interior as expected, and the placement looks random or scattered in a way that doesn’t match the spline’s shape.
I’ve attached a screenshot showing the debug points. Note that in the screenshot, the Interior Border Sample Spacing is set to 50 (to make the points more visible), but the issue persists even with the original 100-unit setting.
What I’ve Tried:
I ensured the spline is grid-aligned (since it’s a cube shape generated automatically).
I double-checked the pivot point of my floor mesh, which is set to the bottom-left corner (X=0, Y=0, Z=0) to align with the 100-unit grid.
I watched several PCG tutorials online, but the setups in those videos don’t seem to have this issue. Their points are placed correctly within the spline’s interior.
Questions:
Why is the Spline Sampler placing points in such strange locations? Is there a bug or a misconfiguration in my setup?
Could the large size of the spline (10,000 units) be causing precision issues with the Interior mode?
Are there specific settings in the Spline Sampler (e.g., Bound/Unbound, Transform, or Alignment) that I might be missing?
How can I ensure the points are placed in a proper grid inside the spline’s interior to match my 100x100 floor mesh?