Glad to hear it’s proving useful!
You can use this Attach Transform To Spline component to attach separate meshes/prefabs to the start/end of a spline. https://gyazo.com/a574e2fb348697445df2e857a4a13f29
Glad to hear it’s proving useful!
You can use this Attach Transform To Spline component to attach separate meshes/prefabs to the start/end of a spline. https://gyazo.com/a574e2fb348697445df2e857a4a13f29
Thanks for pointing me to there. I will try it and let you know how it went.
Version 1.1.1 is now available! This mainly focuses on some quality-of-life improvements, such as quick access to options for creating a new spline mesh.
Added:

Changed:
Removed:
Please tell me if it is possible to add a prefab as a source. You don’t always need a generated mesh. Sometimes you need to make a fence from prefab with lod. Spline Instatiate can work with prefab. Please add this function.
You already seem familiar with the Spline Instantiate component, I would recommend using that, as it does exactly what you’re describing.
Pleased to announce that I’ve opened a Discord server. It will serve as a centralized place to find announcements, discussions and support/feature request forums. Though Unity threads, such as this one, will still be monitored. And documentation will remain up to date. Moving forward, my attention will be focused on the server, in order to streamline continued support ![]()
- Join -
In order to access support channels and feature requests, your invoice number is required. You can find this on your Order History page.
Version 1.2.0 is now available! This is a major feature and usability update
The new “Stretch to fit” option is particularly useful and is now enabled by default:
The number of segments can now be manually controlled:
Procedural and manual roll rotations can now be added:
Vertex color data points can now be added (RGBA):
IMPORTANT: Delete the “Spline Mesher” folder completely when updating from v1.1.3 or older! Failing to do so results in compile errors.
Added:
Fixed:
Changed:
Removed:
Is there a feature to have start/end meshes?
Imagine a bridge with start and end segments that provide ramps for the player to walk up or down the bridge.
Coming back to this subject briefly, as of version 1.2.0 it is now possible to spawn and position a prefab to the start/end of a spline mesh
Version 1.2.2 is now available!
Added:
Changed:
Fixed:
I’m working on a racing game where the track is procedurally generated.
As long as there’s no elevation change to the track, everything is fine. But wherever there’s a gentle ramp, particularly combined with a smooth curve, the mesh ends up being crumpled.
What can I do to correct the issue?
That’s very odd! It definitly looks like floating-point precision issues. What does the Spline look like? Any steps I can take to reproduce this?
Solved it! And it was nothing whatsoever to do with Spline Mesher. The problem was that I wasn’t setting tangents in the SplineContainer BezierKnots. The easy solution to this was to automatically set all the tangents after adding all the knots, with this call:
spline.Spline.SetTangentMode(TangentMode.AutoSmooth);
Suddenly those expressionist distorted track sections have smoothed right out. Phwew!
@StaggartCreations Thanks for your speedy reply!
Ah that makes sense, I can see how that could result in such an outcome!
In case you’re not familiar with it and don’t rely on Knots too much, there is a API for creating Splines from a set of positions:
SplineUtility.FitSplineToPoints(positionsArray, sampleDistance, isClosed, out Spline spline);. This yields a result similar to a Spline with auto-smoothed tangents, but with very few Knots, worth a try for PCG ![]()
Great asset! I’m not sure if I’m blind, but it doesn’t look like the Mesh assets are being properly destroyed when splines regenerate in SplineMesher.cs. It seems like it sets the mesh on the mesh filter without destroying the existing mesh. Is that a bug, or do you handle that somewhere else?
I’ve been tracking down a memory leak recently, so any help would be great!
Second note: I think it’s missing a call to SetDirty too. Otherwise, the mesh changes won’t always propagate to the scene file (and in my case, weren’t properly getting picked up by the ECS baking system).
Profiler.BeginSample("Spline Mesher: Create Mesh", this);
meshFilter.sharedMesh = SplineMeshGenerator.CreateMesh(splineContainer, inputMesh, outputObject.transform.worldToLocalMatrix, settings, scaleData, rollData,
vertexColorRedData, vertexColorGreenData, vertexColorBlueData, vertexColorAlphaData);
EditorUtility.SetDirty(meshFilter);
Profiler.EndSample();
The created mesh gets fed right into the MeshFilter so that it’s automatically handled. What’s possible is that I should use meshFilter.mesh instead. Which is more applicable to runtime usage, is that your case? If so, it’d be worthwhile to try making that adjustment.
This function is typically for editor code, where things are modified outside of normal editor operations. Setting a new mesh to a MeshFilter should already mark it as dirty ![]()
Hm, as far as I know it’s not automatically handled. The old mesh that was stored in meshFilter.sharedMesh won’t be destroyed when you set that reference, so the old mesh will stick around in memory.
Unless I’m wildly off base here? But yeah, runtime generation is the use-case, where the spline might be updating every frame.
Not by my testing! It’s pretty easy to test. Save the scene and click the Rebuild button in the Spline Mesher inspector. Even though the Mesh asset is updated, the scene doesn’t become dirty!
It’s only changes that go through the SerializedObject APIs that automatically SetDirty.
I had a deeper look into it, and you’re right. When using sharedMesh the mesh is not automatically cleaned up, this does apply to the mesh property. That was not my previous understanding
I’ve made some changes where I’m using mesh and also caching the mesh object itself, rather than recreating one with every rebuild operation.
Curious, when the mesh is updated the output object itself does become dirty, but indeed the scene itself is not. Marking it as dirty, through the “Rebuild” button appears to recify that!
I’ve incorperated these changes into v1.2.4, which should be available later today ![]()
Phenomenal, thanks so much!
Spline Mesher released back in March 2024 and has fortunately been received quite well!
Since then, a few major and many minor updates have been made. The functionality and usability is quite mature at the moment, thanks to all feedback and ideas!
Looking at the backlog now, there are still a few key features that would really round out the tool:
These features, particularly the first and last, are large in impact or scope and involve some major changes. After considering the best way to approach that for a while I’ve decided to branch off development into Version 2.0.
Especially since the Job system/MeshData conversion requires redoing the core functionality from scratch, a major upgrade is the most appropriate.
I’ve prototyped all of these features the past 2 weeks and reached a MVP. Mesh generation is a whopping 1300% faster, which alone makes it well worth pursuing further! ![]()
For the area mesh (separate component) I’ve dabbled with 4 different techniques over the years, each having pro’s and con’s. Some users have received various prototypes. For an asset store tool, it’s difficult to decide up front which works best for most use cases.
I’ve gone ahead with a custom triangle grid-based solution, since it’s fast, doesn’t rely on third-party code, and yields practical topology. This sort of functionality has proven crucial for some projects.
Deprecation
As version 2.0 will release, the current v1 asset will have been superseded. This means the asset will no longer be receiving feature updates, but is still prone to fixes. To keep this possible the asset won’t be actually deprecated on the store, for at least a year. If it were possible to “unlist” an asset, that would have been done. I expect the price to be at least $60, with a permanent 20% upgrade discount.
Preview
A preview version is made available for anyone who’s verified their Spline Mesher license on Discord. This is to gather feedback and catch design issue early on
I don’t get any errors inside the editor and everything works fine, but when I build the project, it throws a bunch of errors and stops the build process. Unity 2021.3.45