How do you pass in array of points to a spline mesh component

I made a video to show my problem. Figured it would be easier to understand.

help creating spline mesh from array - YouTube

My Spline Mesh Blueprint. The manual part is working fine. I just do know how to pass in an array to the component to autmatically create the spline mesh

Blueprint spline mesh component posted by delebash | blueprintUE | PasteBin For Unreal Engine

FollowSpline.zip (886.8 KB)

Have a look at BP_Spline

1 Like

Thank you for the response. However, this is the same problem I was running into. The spline points add but the mesh does not extend to the new points.

For a spline with 5 points, you will need 4 Spline Mesh Components. Each SMC needs data from 2 points - start / end locations + (usually) tangents and, optionally, scale and rotation.


If in doubt, please show your implementation of the above.

As of now the spline updates via ConstructionScript. So you can move it or compile it or ceate a custom function out of it and call where you want to

I added a BP_SplineV2 :slight_smile:

FollowSpline.zip (909.0 KB)

2 Likes

Thank you again for your help. I really really appreciate it! One problem is that after you add the mesh via button if you then try to extend or add new points to that spline the mesh disappears. Why?

I think I got it. Just added it back to the construction script as well. Is that the correct way?

It is. There’s also this if you want to combine manual and automatic generation:

2 Likes

Awesome, thank you both!

Once you enable it, how do you hook up?

Thank you again for your help. I am trying to automate this process instead of having to click create mesh. Also after you have added the points you should be able to manipulate the spline and have it automatically populate the mesh without having to click add mesh. Another problem is after you add the points if you just move the spline BP in any direction the points disappear. I changed add mesh and add points to functions instead of events. I then added a call in the construction to add mesh. I have tried several different things to get it to work. If I call AddMesh in the constructor it does not work unless I set it to Local Space. But then I get 2 images of the spline, one with the mesh and one without.

Trying to achieve

  1. Drop a spline in the world.
  2. Add points to the spline either automatically as soon as I drop it or click a button
  3. Mesh should always be applied automatically
    4)When you move the spline around the mesh should not disappear

Here is a video of my problem. Again, I really appreciate your help I have spent many hours on this. It seems like it should be simple. LOL

Spline mesh problems - YouTube

Erm, you mean like BP_SplineV3? :smiley:
FollowSpline.zip (928.8 KB)

2 Likes

Yes, that is perfect. Thank you again for your help. You are awesome. Cheers!

1 Like

Thank you again for your help. I am trying to add your solution to my track generator, but I am getting weird results.

Here is a video of my problem.

(2) Spline Track Generator UE5 - YouTube

Sample project.

I’ll have a look.

1 Like

Thank you very much.

A little more info.

trackgenerator2 - YouTube

You have to switch the CoordinateSpace now. Because you changed the SceneRoot=Spline the coordinates are different. Now the points you add are local (in relation to the spline)

Or you add back the DefaultSceneRoot and have the Spline as a child like before.

Edit: Your variables names remind me of a tutorial from 2014 :slight_smile:

Yes, only that in the picture has to be local.
Erm, I can try to adapt the tutorial to my design if you want to.

That fixed the mesh. However, after clicking create points if I move the BP position the added points disappear. I changed Create Spline to Local and left Add Spline Point at index at World. If I change that to Local the mesh gets messed up.

You are correct. I watched the video from Unreal. Very cool tutorial.

[Using Splines & Spline Components | Live Training | Unreal Engine - YouTube](- YouTube

I would very much appreciate that. :slight_smile: