How to create 2 different meshes following one spline in Blueprint

I’ve took basic “BP Spline Mesh” pattern that is shown on every YT tutorial that i’ve watched, like this for example Unreal Engine 4 Tutorial - Splines - Spline Meshes - YouTube or any other. And i am trying to figure out how can i achieve placing two different meshes on one spline via BP.

My use example is - i have a simple road section and a bridge section, i want them both to lay out on a one spline and going one after another.

I am pretty new (2nd day) at using BP’s and so after about 10 hours of researching this is what i came up with and it seems like a right decision, but it just doesn’t work. Help please!

On the left of the screenshot (which isn’t visible) there is only a basic SplineMesh pattern that i’ve created following all these tuts. Sorry for possible mistakes, english isn’t my native language.

You can use this piece of code to set the mesh to one from an array ( in this case random ):

349819-screenshot-8.jpg

( Two different pipe meshes on one spline ).

Thanks for the reply. Your answer pushed me to the right direction i guess, i am currently trying to implement it the way i want it to act, not randomized, but on an intentional behavior.

Randomized was just an example… :slight_smile:

I understand that. Random values can be set inside of “For Loop”, so that every time i drag my last spline point, my loop iterates and spawns a random mesh, i got the idea here.

Let me try to explain you the idea i am trying to realize:
First of all i create an iterative loop that creates a “RoadMesh” once my SplineLength reaches “RoadMesh” length. This loop will iterate unless i stop it through some condition, like "if index count for “For Loop” LastIndex input will hit a value of 10, then my code flow shall run to the another part, where there will be added BridgeMesh, then, on index 11 and further it will continue adding RoadMesh, unless i set multiple values for BridgeMeshIndices, that way it would create BridgeMesh on a certain Indices that i will set. I can’t even figure out how to change my flow the right way. I’ve tried using branch node in conjunction with Break input of “For Loop with Break” node, but this just vanishes all the data that this loop creates.

I think i found a way to showcase how my current setup looks like.

Hi, would it be possible to see the full BP ? Thanks!

What do you have so far? Can you make it happen with one mesh?

So when i add array slots and populate them with meshes, i get some random mesh spawning along my spline but all copies are the same, when i move the spline point, all meshes change but with the same mesh everytime.

1 Like

I can see you have some stuff missing.

You need an ‘add static mesh component’, and later, change the mesh randomly.

I’ll come back.

2 Likes

Here’s your basic meshes on a spline

basic

It’s up to you if you want to have a parameter for the number of meshes, or the distance between them. I don’t recommend bounding box, when you tilt things, it all goes pear shaped, but it’s up to you.

Anyway, once you have that, you can randomize the mesh with

image

random

4 Likes