Spline Component and SplineMesh component basic setup tutorial

Hi guys and gals.

First video I’ve done here. It’s a basic look at spline components and spline mesh components. Feel free to comment on the video and give me any suggestions for improvements.

I think you need to change your link? It sends me to my own video channel :slight_smile:

Rama

Thanks rama. Yeah I was pasting a generic link. Cheers it should be fixed now :slight_smile:

Thanks for the tutorial this is great!

Do you think it would be possible to setup a blue print that would allow different meshes to be used at different locations along the spline (start and end as an example)? Also i’m trying to figure out how would I go about setting it up so that it deforms a single mesh over the entire length of the spline? I’m using “GetNumSplinePoints” but it’s not giving me an end point.

Thanks again for the tutorial!

Cheers,
-K

If you want different meshes to be placed along the spline, then you could create an array of splinemesh components and as you loop though the for loop, use the mesh at the that point in the array using the same loop number to index into the array. You would have to create as many elements in the array as you have points though.

I did set up a version of the graph where it gets the length of the spline and equally spaces out meshes using the ‘get world point at distance along spline’ (or whatever its called) along with the tangent version, but the meshes didnt get deformed properly along the spline. they were deformed at the start and end points but the deformation quickly fell off along between mesh division so it wasn’t really usable to get smoothly deformed geometry. I’d like to hear from someone at epic about how to get that working. I’ll want to investigate further but dont have much time at the moment.

If you want just a single mesh deformed, then create a single splineMesh component in the blueprint component tab and connect the start and end positions and tangents directly to that spline mesh by getting a reference to it. If you watch the video where I demonstrate that with a plane, then that is how you do it.

Thanks for your reply.

I was able to get the spline to deform a single mesh but I am getting a similar result to what you describe where the mesh would deform to the start and end point but middle part of the mesh wasn’t deforming along the spine correctly (if at all really it just looks like the mesh is snapping to the start and end).

In my previous post I was trying to sort out how to get the last point index from the curve without having to manually set it in the blueprint. I thought I could do this by using “GetNumSplinePoints” and plugging this into the point index for end position but this doesn’t appear to work.

You need a point in between the start and end points. That way the tangents will point towards the middle point.

getNumSpline points returns the actual number of points but spline points are numbered with a 0 based index. So the first point is numbered 0 and then 1 and so on until the last one which is equal to numberOfPoints-1.