Hello friends! After days of programming and hours of testing and optimizing I am finally proud to present my first extension for the Unity Editor to you: Super Splines! Did you ever need to have splines supported in the Unity Editor? Or did you ever want to quickly generate a road with only a few clicks? Or did you ever have to code a script for a Camara that follows the player on a predefined path? Well I did! A couple of weeks ago I had to face the problem that Unity doesn't directly support animation of objects along dynamically generated curves. Working on a project that would make heavy use of splines and other curved paths I had to write a powerful and efficient spline interpolator myself. During development of that project the spline interpolator's range of functions had also been extended continuously, so I decided to make it a separate project and share it on the Asset Store. By now it supports – among other things – 3 different curve types (Hermite, Bézier, B-splines) , 3 different ways to interpolate rotations, Mesh deformation (used for roads, tubes, ropes, tunnels etc.) and it provides handy functions that take the work out of programmers' hands. This website demonstrates and explains some of the most useful features of Super Splines. You might check out the online reference in order to see the variety of functions that Super Splines offers. You can download Super Splines on the Asset Store at the price of 25$. You can also download the pro version of the Plugin on the Plugin which includes all of the project's sourcecode at the price of 65$. To get a better idea of what Super Splines looks like in the Unity Editor, here are some screenshots:
Haha, where were you 2 days ago when I needed that and had to roll it myself This is looking great, I might get it I suppose you have implemented arc-length parameterisation to move objects along the curve at constant speed? Also, would it be possible to have a look at the API (online documentation or something equivalent would do) to get an idea of the scripting methods exposed, please?
Yes, objects are approximately moving at constant speed along the spline, although I used a numerical rather than an analytical approach to achieve this. I planned to implement an analytical technique in a future release of Super Splines. If you want to get a little overview of the API you can check out the documentation.
Hi, I checked your API a bit, it's looking good. However, I couldn't find a method to get a point on the spline at a specific distance from its starting point - Did I miss it or is it not available? Also, do you have a practical example on how to use your package to make an object follow a given spline? I'm really tempted to get this, especially at such a nice price point, but i'm a bit reluctant due to the sources not being included. I've had too many problems with black box products in the past. Would you consider either including it with your package (and maybe bump the price up) or selling it as a separate package?
Ok, I have to admit, this could be a little tricky with the current version of Super Splines. Basically all points on the spline can be calculated using the function Code (csharp): Vector3 GetPositionOnSpline( float param ) param can be a value from 0 to 1, where param = 0 will return the start point and param = 1 will return the end point. If you want to get a point with a specific distance to the spline's start point, you would have to divide the desired distance by the whole length of the spline in order to normalize it to the interval [0..1]. The problem is that Super Splines doesn't store the spline length in the component, although it is calculated in the code. (I wonder why I didn't store it ) I'm going to fix this in the next days and add some new functions for calculations using the actual spline length. Sure. Here's the SplineAnimator-Script that is also included in the package! Yes, no problem! I could release a pro-version of Super Splines with the source code included at a slightly higher price. Maybe I will do so within the next two weeks.
Hello Nococo, in PLAY mode , i try making diseappear spline and control nodes by unchecking Mesh Renderer with no success . Any advice ? Thanks.
Hi Sefou, the spheres and lines are gizmos, so they are drawn automatically by Unity. In order to make them disappear, just klick the "Gizmos"-button in the right upper corner of the game-view. That should do the trick! Cheers!
Hi folks! I just uploaded a little update that fixes some bugs and adds a variety of new functions. With the new version you can calculate lengths and distances on the spline! A new class called "SplineSegment" has been implemented allowing you to determine between which control nodes a spline parameter / point is located. Also the other classes offer more functions for easier handling. For more information on the new functions, check out the improved documentation . Releasing the first update I also uploaded a pro version of Super Splines that contains all source code related to the project allowing you to alter it's functions to fit your game project perfectly. The links to the new versions of the plugin can be found in my first post! Cheers!
I know this is an editor plugin that will help me generate splines. But if I create a spline that moves through a tunnel will it work for iPad or iOS devices?
Yes, it will work for all current iOS devices! I tested it on iPhone 3GS, iPhone 4 and iPad 1 2 and it worked fine.
I Have purchased this tool,How do I create a traffic simulation with this? The city roads are models,super spline can create splines snap to mesh?
In order to simulate traffic with Super Splines I would do the following: Setup some control points that describe your roads paths Connect these control points with the plugin's Spline-component if you don't have road meshes yet, let them be generated using the SplineMesh-component Write a script that animates vehicles along your splines (you can use this one as a reference) Maybe simulating traffic on crossroads will be a little tricky: your splines would share some control points and you would have to check when a vehicle should switch from one spline to an other one. Traffic simulation certainly is possible with Super Splines, but if you have any further questions, just contact our support. Cheers
Hello folks! There has been a second update to the plugin bringing you the following improvements: More accurate velocity-constant interpolation Advanced UV-mapping-functions Improved performance: Length calculations are execudted nearly twice as fast Check this page for the complete changelog! Cheers!
<..< advanced UV mapping functions? do tell. Are you now able to use spline mapping like in 3ds max? Cause I tell you that is win If I can import splines too, that would be the amazing.
Whoops I've just corrected this one! @larvantholos: Actually the new UV-mapping options enables you to define how often the texture will be drawn onto a mesh that you create with the plugin's SplineMesh-component. Thus you don't have to set the texture tiling in the material-properties allowing you to use only one material for multiple meshes of different length that have been generated with SplineMesh. I'm not that familiar with 3ds max, but I suppose that's not quite the function you're looking for. Nevertheless you can tell me what function you would like to have and maybe I will implement it in the next update.
Hi! I've been using your library (great work!) and I found a leak problem with the SplineMesh component when I was profiling a game. I guess it has something to do with the "bentMesh" field which it's created at runtime (you know "new Mesh();") but it isn't freed for some reason. Have you forgotten to destroy it? (using the "OnDestroy()" method) Thanks in advance. PS: Sorry for my bad english PS2: Wow! my first post
if I use a 4 pnt bezier curve and GetClosestPoint is the end point, I get an IndexOutOfRangeException. The normalizedIndex on line 333 in Spline.cs is being set to -1. There are 3 segments, so perhaps this needs to be -3 instead of -4.
Thank you for reporting these bugs! I'll have a closer look at the plugin's code as soon as I can. By the way, there has been an update some days ago. New and important features are: Option to generate seperate meshes per spline segment Quick-Infos that can be acessed via keyboard shortcuts and that show basic information about the selected spline A detailed changelog can be found here! Moreover I've uploaded a short video that shows how to create a road and animate some gameObjects using SuperSplines. Cheers!
Hi, does SuperSplines support custom UV mapping? cause i am working with texture atlases, where each object uses only a part of a big texture atlas.
Is there any way to change how the mesh is centered on the spline? I'm trying to create a track with two meshes using the same spline (one for the road and one for the railing). The railing always goes up 0.2 units even though the railing is created from the same 3D model as the road.
I came from iTween, HOTween and others looking for a solution that allows me to move the splines in real time, but still be able to draw it on the screen initially. As in, the central empty gameObject which holds supersplines together is perfect for this project. This would seem to be the solution so I purchased this... however, there are some features greatly lacking in the animator script that I would like to address in comparison with the free solution. If you get iTween and the Visual Editor script you might easily see some of the features that I am talking about. I particularly require for my project something like the onstart(), onfinish() functions. I didn't notice anything in the documentation that would trigger another method to happen when it began or completed. Having such a thing accessible from the spline animation script would be splendid. Also another requirement is being able to assign an animation to an instanced prefab, but I was unable to figure out how, if there is a way. I could only get the splines to work with objects already in the scene. If I can instance the spline paths as well, that would be even better! I would instance them as a pair. However, it seems they come as a 'clone' and thus I cannot set it to that instance. I cannot set a prefab spline into the animator either. Thanks to anyone who can assist me. I aim for the attention of the developer most of all, however.
Great package, exactly what I was looking for! I do have a question though, there is a gravity demo which looks interesting, however it doesn't work and has some missing scripts on the path nodes in the scene. What script is supposed to be attached to it?
Just bought this, and I'm noticing some odd behaviour. I created a B-Spline in my scene. I moved the control nodes around, then moved the base point around, then went back to move a node again and the spline disappeared. Selecting the spline and/or the nodes in the scene hierarchy does nothing. The gameobjects are still there, but no spline. I tried reloading the scene, restarting Unity, but the spline has just gone, leaving the gameobjects (with scripts) behind. I'd also like to know if the memory leak reported earlier in the thread (by DanielM) has been fixed.
Right now I am using the splines for a racing game. While running next to the player it appears that the characters on the splines are stuttering, but when I attach a camera to one of those characters the character does not appear to shake or stutter. Could it be a conflict in update speeds between the camera and the spline? Do you have any suggestions for what it could be or how to fix it?
I encountered a similar problem. While you cannot adjust the position of the nodes through the spline, you can adjust the position of the nodes themselves by using a reference to the nodes as children of spline.
Hi! Is there somewhere a change-log? Cause i'd like to know what have changed from 1.2 to the 2.1 version? Also i ask myself, like SOIL did above, does it provide custom uv mapping? Can be to the middle parts also cap start and end parts added?
For all others out there - yes it does support my so called "custom UV mapping" btw the right term of it is "DonInterpolate" - Didn't know that before xD
I may need some help: here is what I want to do, 1. have the car follow the spline from a starting node to an end node 2. once reach the end node, I want the car to keep the same angle, rotation and speed 3.the splines and the car have to be independent from one another as soon as the car reaches the end node. It is a crash crazy simulator game I want to create. Just not sure where to start in the scripting part. thanks for the help
Notice that super spline 3.0 is already out on your website. You guys should update the corresponding info on this thread....so that you can attract more potential customers...to try this awesome handy plugin
Hello, I am trying to make a train track like this link. http://www.trainboard.com/railimages/data/511/layout2.gif CAn I do this with super splines? I tried Branching Spline scene but can't find how to make intersections between different splines.
Is the SplineAnimatedCamera script missing?? I can get the animation to follow the mesh, but it needs to be offset above it... it never places the camera above the road.. how can I fix this please?
hey, thanks for this great asset, I do have a question tough that i can't figure out just yet. Is there a way to access the first node of a spline. I need this to spawn objects at the start of the spline. Thanks for your time EDIT: i think i just found it: splines[0].GetPositionOnSpline(0); // returns the vector3 possition of the spline 'splines[0]'
Hey all Maybe someone can help me here I picked up Supersplines and I want to instantiate a single game object on one of 4 splines using a Random.Range. like this... The game object would instantiate. pick one of 4 splines in an array. Attach itself to that spline. be on its merry way until it reaches the end or something destroys it. I tried to create an array in the SplineAnimator script but it wont let me, any help would be awesome Thanks
i am making bike game and i want to move bike in curved path with physics this is how my bike moved forward can any one help me to do this bike able to do jumps ,flips and etc ...
Hi Evolua Team, I'm currently using SuperSplines 3.0 in a Unity 4.6 project. It works great! When I update to Unity 5 I get a few errors from your scripts. Are you planning to upgrade SuperSplines to be useable in Unity 5? Cheers, Felix
Hi there. I was curious if SuperSplines would be appropriate for creating a map with smoother coastlines like this: My goal is to have a landmass with a spline-based natural coastline, but with a texture inside the shape for more natural-looking grass. (Mainly ignoring the mountains and trees for now.)
Given a branching spline, how can I find which junctions are coming up ahead of an object travelling along the spline? The JunctionController code in the demo code handles when you have passed a junction but I need to know which junctions are ahead.
Hi, could anybody help? im trying to create a script telling my animated gameobjects to appear & loop around the spline randomly. So if i select 10 units, 10 units will appear randomly on the spline & loop around the spline thanks
Is this package still supported? I haven't seen an update since 3.5 and no posts since 2015. Does it work with Unity 5?