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):
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:
The issue when I try to alternate between which static mesh is added:
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):
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:
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…
https://forums.unrealengine.com/core/image/gif;base64
The final part of the blueprint works out the start/end tangent/position.
https://forums.unrealengine.com/core/image/gif;base64
Any help and advice is greatly appreciated.
Many thanks,
Mark