Curvy Splines solves this issue.
You can see the performance difference in this video I made comparing both solutions. The following link takes you directly to the performance section:
The use case in the video, which is very similar to yours, runs 5 times faster when using Curvy Splines.
Additionally, you can use both Curvy Splines and the Splines package together in the same project. This is possible with the following asset that converts splines between the two solutions, in both directions:
I am the maker of both Curvy Splines and Converter, so feel free to ask me questions about them.
@ThomasLopez do you guys have a mechanism / utility function to create a concave hull out of a list of spline knots? Or eg to create a union of multiple closed splines?
We didnāt try that on our side, but jjust quickly thinking about that, you could animation the SplineAnimation normalizedTime from the Timeline and that should do the trick.
However, maybe you wouldnāt need to use the Spline animate componentā¦ You just need your timeline to animate a number in [0,1] and then use that number to evaluate the spline position/tangent/up (depending on your needs) at that normalized distance.
The main point of the Spline Animate is that you can move an object along the spline without a timeline, bubt as soon as your animation is handled by the timeline itself, there is less beenfits to use the spline animate componentā¦ The only ones would be the ping pong effect and the auto-looping I think.
Hello, i wanted to report you a bug with splines and prefabs:
If i duplicate splines of a splinecontainer in editor (CTRL+D), and then duplicating its gameboject, the splines duplicated disappear in that new gameobject.
And it happens only when the gameobject is linked to a prefab with a splinecontainer. Bug not occuring if the prefab doesnāt contains splinecontainer.
Thanks!
@ThomasLopez Is there some way to create multiple lanes out of a spline, ie a utility method for the creation of the left and right side of a center source spline?
Will there be a gizmo for spline container/spline instantiate component? It is very difficult to select the spline component if I instantiate effects which have a lot of objects which block the cursor.
I have a lot of splines in my working scene, they work fine. If I move one of the splines to another scene, run PlayMode or just open this scene again, I see a lot of objects and they are transferred to zero coordinates, as if I pressed Bake Instance. I did not press Bake Instance, I just run the game or open the scene and what I wrote above happens. What could it be?
Iām using the spline package in a 2D project and hereās my feedback:
Menu actions for spline templates have no 2D counterparts (i.e., GameObject/Spline/Cricle). The splines created this way are not visible in the Scene view thatās using ā2D Viewā because theyāre on a different plane. You could rotate the entire spline game object but itās tedious and forces you to use different rotation for no good reason.
When modifying tangent position in 2D view (while having grid-snap turned on) the knot rotation can change automatically. It makes it so that knot gizmos become invisible on 2D plane making the workflow very frustrating
Simply adding knots sometimes hard freezes the editor which requires force quit.
My overall impression it that the system wasnāt really tested in a real world 2D workflow.
This is probably because if you change the Spline during Runtime, in the SplineExtrude script Rebuild() starts being called on each Update(). You can fix it by editing the SplineExtrude script yourself and rebuild only once after you modify your spline.
Hi @KVN31 ,
Iāll follow on @MihailLuhov answer. How often are you modifying the Spline is a good question indeed.
Spline extrude is meant to be a 1 time call because itās expensive.
Everytime the spline is modified, the entire mesh has to be regenerated. So, for instance, animating a Spline knot with a SplineExtrude component will not be good at all in term of performance as all vertices, triangles, normals, UVs will have to be computed at every frame. In that case, defining a new Component to animate a mesh along a spline without regenerate the whole mesh asset should be a better solution
Hope this helps