Download

Adding Multiple Meshes to Spline issues

I’m trying to create a tunnel level as part of teaching myself unreal engine… I watched some tutorials on how to add spline meshes and have been tweaking that to be able to add multiple meshes.

I’m finding an issue with one part of the mesh becoming invisible when I try to add it at a specific point… I’m still very new to unreal so most likely I’m missing something obvious.

There are 3 spline points (0, 1, 2) and I’m trying to add the stair section, for which I have an alternate mesh roughly at spline point 1.

I have a stair section and side section mesh which are the same length (2500cm):

](filedata/fetch?id=1831099&d=1605033011)

Individually I can add these to the whole spline no problem and in fact in these next two example pictures; all I did was toggle the condition, that chooses which piece of static mesh to add the spline, true/false:
51a47b370e7c39a72dd088101c0c914687599f15.jpeg](filedata/fetch?id=1831101&d=1605033385)

The issue when I try to alternate between which static mesh is added:
0f22b1b0e09290e2f773d690818e015acfd2f19e.jpeg

There should be a section with stairs where there is an empty space.

Here’s the whole blueprint (so you can gather which bit we’re at in the zoomed in picutres):
708d0e496eaa3d913fdcfe6097901d4f54d154e6.png

The start section is to work out how many times we need to loop through and add each static mesh to the spline. And also add meshes that I want to be present along the entire length of the spline:

6d52d3f67dd2d7a44be014c66db3b28c600f9416.png

The second part is where the issue occurs. The math I’ve used to work out the loop index for where I want to add stairs is this:

  • Get distance of spline point 1 (middle) along the spline = 7175
  • Divide by section length; 7175 / 2500 = 2.8 (truncate to 3)

For now I’m just going with a hard coded loop index point but the blueprint will work it out based on the spline point you want a staircase at (roughly).

So I check if the main_loop_index is the same as the index I want the stair mesh to be added and add it… it seems like this should work and it looks like this is where we get the “invisible” bit of mesh but I don’t understand why it won’t add the stair mesh when it does work…
14c5fae5597f954b460879b328662725d942497e.png
https://forums.unrealengine.com/core/image/gif;base64

The final part of the blueprint works out the start/end tangent/position.

b112f63d6000b8d4f5c04f4320dd5875c5750ed5.png
https://forums.unrealengine.com/core/image/gif;base64

Any help and advice is greatly appreciated.

Many thanks,
Mark

It would be best if you left the stair area empty and manually applied a mesh to it - unless you plan on doing something weird like bending the stair case area - which would distort anything you snap to it as well.

Also, I would work it as a spline point index rather than the spline itself.
Meaning, if you add two points to the spline and the distance is less than X between the 2 points, then you automatically use the stiars mesh and force the segment to always be straight (construction script to override any movement you make to the 2 points).

Overall, unless you are specifically making something that you will use over and over (a tunnel game?) I don’t really see much of a point in putting all the effort needed to get it to behave somewhat correctly.
Additionally, the seams of the tunnel are likely to cause 1000 issues with lighting artifacts because of the spline.
The lines in your screenshots are probably it. getting rid of them is hard and/or involves some Z fighting at the edges of the meshes.

What I would do, is take the system you have, build the base tunnel by moving stuff around. Merge Actors to obtain static meshes. move the meshes to a 3d program. Re-Cut the segments at proper increments for occlusion, export them out, and re-assemble a clean tunnel.
Again, if it’s a 1 off.