Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Dreamteck Splines - Powerful and Flexible Spline Solution

Discussion in 'Assets and Asset Store' started by Dreamteck, May 11, 2016.

  1. Dreamteck

    Dreamteck

    Joined:
    Feb 12, 2015
    Posts:
    336
    Hi and thank you! It isn't possible to have different randomized textures using the Path Generator tool because that would mean different materials and therefore - different material IDs. However, you can achieve this effect using the Extrude Mesh component. Create several variations of the path model which have different material IDs and set them to order randomly. Then apply the different materials to the renderer.

    Can you please specify what you mean exactly by curves looking different from the more straight areas? Do you want to have a procedurally generated spline with different curve radius?

    It all comes down to using SplineComputer.SetPoints(). This method will let you set the control points of the spline.

    Best regards,

    Mitko
     
    mcmonk likes this.
  2. mcmonk

    mcmonk

    Joined:
    Sep 22, 2014
    Posts:
    14

    Cool, I will try that thanks :)

    Regarding the other question it was just if you could procedurally set the texture according to e.g. spline point angle. But I will try the other method :)
     
  3. neapolitanstudios

    neapolitanstudios

    Joined:
    Feb 17, 2011
    Posts:
    75
    I am very close to buying this, However I am not sure if it will be appropriate for my project.

    I need a train type system built in unity, and this seems like it would work amazingly, especially with features such as junctions. However I am unable to find any reference to having multiple objects following a spline.

    Is setting up a train with carriages possible with your spline toolkit?
     
  4. Dreamteck

    Dreamteck

    Joined:
    Feb 12, 2015
    Posts:
    336
    Thank you for your interest in Dreamteck Splines! And yes, making a train system with junctions is possible with our system and has been done a few times. However, you will need some additional coding to achieve this. Our API provides everything that you will need to build a system like that. You can have a single object follow the spline and then have other objects, evenly spaced along the spline. You can project the wheels of a wagon on the spline etc. The part that will require the most coding will be handling the junctions. You will have to figure out the best way for you to handle cases where part of the train is on one spline and the other part is on another spline - you would have to keep an array of all splines currently traversed by the train in order to properly project the wheelbase onto the splines.
     
  5. Riddhi_Kothari

    Riddhi_Kothari

    Joined:
    Feb 8, 2017
    Posts:
    1
    Your plugin is wonderful.The only help i need is how to change offset value of transform position (Splinefollower.cs)through script. I need to change offset value runtime through key controls.
     
  6. Dreamteck

    Dreamteck

    Joined:
    Feb 12, 2015
    Posts:
    336
    Hi Riddhi,

    Thank you! I believe we spoke on the support e-mail. If this wasn't you and you still need help with this, hit us up at support@dreamteck.io!
     
  7. SunnySunshine

    SunnySunshine

    Joined:
    May 18, 2009
    Posts:
    974
    I just bought this asset, but it's behaving very oddly. Whenever I change, or try to change properties, the spline and all its points disappear.

    https://gfycat.com/HardtofindKnobbyLemur

    When I sometimes am able to get the XYZ properties to display, changing them doesn't seem to affect the curve permanently. Whenever adjusting the curve in the viewport again, it just resets to its previous state.

    https://gfycat.com/WhoppingAnxiousJoey
     
    Last edited: Oct 23, 2017
  8. Dreamteck

    Dreamteck

    Joined:
    Feb 12, 2015
    Posts:
    336
    Hello SunnySunshine,

    Thank you for using Dreamteck Splines and apologies for the late response here.

    Can you please address this issue to our support e-mail: support@dreamteck.io We don't log in very often here in the forums. It seems like an exception is being thrown, it would be great if we could take a look at the exception contents.

    We are currently working on a new version which will fix the property setting issue. The new version should be on the Asset Store within a couple of days.
     
  9. dragonkioku119

    dragonkioku119

    Joined:
    Jul 16, 2017
    Posts:
    13
    How easy is it to have splines with colliders growing outwards to their final shape over time? I'm looking to be able to do things like this:
    in my game and am wondering if this would be the best system for it. I started heavily modifying another system, but this one seemed to already have certain features I would have still needed to write myself. Also how easy would it be to manipulate or move certain defined segments of a spline in game? I do like that you have triggers for things moving along the splines because I was going to make my spline system also my movement system for certain types of objects and would want them to be able to change speed at check points and such. I'm basically trying to end up with something that that could make it easier to design/develop any sort of curving laser, bullet, or enemy movement pattern in a bullet hell game. For the lasers of course that's where the need for colliders that match what is being rendered comes into play, which I see you have but as mentioned would need those to be able to update and reflect parts of the full shape over time as the laser grows/moves along it's path/etc.
     
  10. kosukito

    kosukito

    Joined:
    Sep 6, 2014
    Posts:
    8
    Hello, i recently buyed the asset, and is awesome, i only getting some trouble to understand if there is a way to get te worldposition of a clip range of a spline.
    i mean, i got a spline that i shrink like the raycast example of the asset using the clipto, but what i want to know is how to find in code the world position of that point, i want to know the world position of percent of the spline, can you give me some light please?
    the asset is amazing thanks
     
  11. Dreamteck

    Dreamteck

    Joined:
    Feb 12, 2015
    Posts:
    336
    Thank you for purchasing Dreamteck Splines!
    The way to do this is to call the Evaluate method on your user and pass the clipFrom or clipTo property as an argument:

    SplineResult result = user.Evaluate(user.clipFrom);
    Debug.Log(result.position);
     
  12. Dreamteck

    Dreamteck

    Joined:
    Feb 12, 2015
    Posts:
    336
    Hey everyone! We're doing a Christmas giveaway and we're giving away 8 keys for Dreamteck Splines. The winners will be drawn on the 25th of December.

    You can enter the giveaway here. Good luck!
     
  13. AlexSkylark

    AlexSkylark

    Joined:
    Nov 10, 2015
    Posts:
    6
    Hello!

    this is a great asset and I wanted a lot to use it instead of my current implementation, but I'm having some issues with the Spline Follower in 2D

    Basically, the objects following the spline are not being flipped toward the camera, specially on curves, because they are being treated as 3D objects following the path as if it was a train track facing AHEAD.

    Can anyone help me get the objects to follow my spline in 2D like the current state of my game? (notice how the enemies follow the splines in the following video:
     
  14. potatojin

    potatojin

    Joined:
    Apr 11, 2012
    Posts:
    23
    This package looks great and I'm excited about getting it integrated into my project, but I'm having some trouble getting started...

    I was hoping you could tell me more about order of execution and the proper way to configure SplineFollowers, SplineUsers, and SplineComputers created at runtime.

    What I'd like to do is create a bunch of splines at runtime, to use as roads in a procedurally-generated city, then dynamically spawn vehicles using SplineFollowers to follow the roads.

    Creating the splines works great. Setting up the vehicles to follow the SplineComputers works great too, but is slow, because each follower resamples the computer. It seems like the correct way to set this up is to give each spline its own SplineUser, which will cache all the samples, then set each SplineFollower's SplineUser value to the user for the spline I want it to follow.

    This is where I'm running into trouble. When I point a SplineFollower at a dynamically-created SplineUser, I get the following error:

    IndexOutOfRangeException: Array index is out of range.
    Dreamteck.Splines.SplineFollower.Move (Single distance) (at Assets/ThirdParty/Dreamteck/Splines/Components/SplineFollower.cs:250)



    It seems like the SplineUser hasn't built it's sample array yet? Or something?

    What is the proper order in which to do the above? Am I right that the problem is caused by an uninitialized SplineUser? Is there some kind of callback I can check before trying to move Followers along dynamically created Users?

    Thanks in advance for your help. Apologies if I'm missing anything obvious, but the documentation doesn't have much information on doing all of this stuff dynamically at runtime.
     
  15. Dreamteck

    Dreamteck

    Joined:
    Feb 12, 2015
    Posts:
    336
    Yes, the reason you are getting this error is probably because the SplineUser hasn't built its samples yet. In order to rule out this issue, make sure to call RebuildImmediate(true) on the SplineUser as soon as you create it. Then you shouldn't have any problem referencing it inside the SplineFollower.

    Let me know how it goes. Also, our support is a lot more responsive at support@dreamteck.io so if you have urgent matters, you can count on our e-mail support. We check the forums once every couple of days. :)
     
  16. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,027
    I'm looking for a possible alternative to Curvy splines. I mainly use Curvy for path following. I need a way for objects to follow a spline at varying speeds and be capable of orienting to the spline in either 2D or 3D orientation. I also need to be able to know in code whether an object has reached the end of the spline. Can this asset meet those requirements?

    Also, how does performance compare to Curvy? I am noticing in Curvy that path following is CPU intensive well beyond what I would expect.
     
  17. ridha

    ridha

    Joined:
    Feb 12, 2016
    Posts:
    2
    i cant place point on terrain or mesh i tried to re import the package and nothing happens ... please i need help
     
  18. Dreamteck

    Dreamteck

    Joined:
    Feb 12, 2015
    Posts:
    336
    Yes, you can achieve all this with Dreamteck Splines. Our SplineFollower component can change the speed of following and you can find the percent along the spline easily like this:

    GetComponent<SplineFollower>().result.percent

    You can also convert this to distance in world units:

    SplineFollower follower = GetComponent<SplineFollower>();
    float distance = follower.CalculateLength(0.0, follower.result.percent);

    Performance-wise, the follower isn't a very heavy component. It uses cached spline samples so the spline is not re-calculated. However, there are a few Vector3.Distance operations taking place in order to make sure that our follower follows with uniform speed. Usually the most CPU intensive operation is changing the spline. If you change the spline, the follower will have to re-calculate the entire spline again. Usually we have scenes with 30-50 followers running simultaneously without a problem. However, keep in mind that by default your spline will be sampled 30 or 50 times (depends on how many followers you have) which will have a significant performance impact. The solution to this is to use a SplineUser sample target - have a single SplineUser sample the spline and set all followers to copy the results from it (this is explained in the documentation, available here: http://dreamteck.io/page/1).

    Have you set up your layer mask correctly? Make sure to click the "Layermask" button when in Surface mode and select "Everything" if "Nothing" is selected.
     
    magique likes this.
  19. JLO

    JLO

    Joined:
    Nov 11, 2012
    Posts:
    46
    Hello, first I must say this is a great asset. I'm really enjoying it. :D

    Though I might have a feature request for the "Extrude Mesh" function. Say for example I have Bridge object that consist of two meshes a "walkway" and "side rails", and for both I need the end vertices to connect to form a solid walkway and solid side rails across a spline.

    Currently, if I were to try this in "Extrude Mesh" I would up with those meshes being placed one after another along the spline, which in my case would not be ideal. What I would like if there was an additional way to layer/overlay meshes across a spline (along side the already existing ordered and random mesh iteration function). That way If I have a single complex Object that's made of multiple meshes and materials (that need to be extruded across a single spline) I wouldn't have to use multiple splines to extrude only one single mesh component at a time.

    The "Object Controller" was almost what I needed, but again I need the ends of a mesh to connect to each other to form nice flowing geometry which I get in "Extrude Mesh".

    If this feature is not already implemented and I just overlooked something, I think this would be a great additional feature to add to "Extrude Mesh" that would be more efficient than doing workarounds that would end up being more time consuming.

    Thanks.
     
    Last edited: Feb 24, 2018
  20. aler_buffon

    aler_buffon

    Joined:
    Dec 9, 2015
    Posts:
    22
    Hi, thank you for the wonderful asset, but I have a problem.
    I use the component "Object Bender".
    I bake lightmap, after that I bend part of the level, the lightmap breaks.
    After that, I'll bake the lightmap again, but the 2-channel channel is spoiled.
    How can I solve this problem?


    Screenshoot
    http://take.ms/qJkXm
     
  21. Dreamteck

    Dreamteck

    Joined:
    Feb 12, 2015
    Posts:
    336
    Thank you for using Dreamteck Splines! @JLO , the feature request has been accepted, a new version of Dreamteck Splines should be released by the end of the month.

    @jenkaro3 this looks bad. The object bender is still in BETA after a lot of time (because it's a more complicate component) and it doesn't handle lightmap UVs yet. We will look at it and see what we can do to help make it lightmap compatible as soon as possible. Also, please note that for support, inquiries our support@dreamteck.io e-mail is more responsive and we can provide quick fixes there. If you write in the forums, you need to wait for a new version to come out in the Asset Store.
     
    JLO likes this.
  22. aler_buffon

    aler_buffon

    Joined:
    Dec 9, 2015
    Posts:
    22
    Thanks for the answer, I will wait for these changes.
     
  23. JLO

    JLO

    Joined:
    Nov 11, 2012
    Posts:
    46
    @Dreamteck Great, thank you! Looking forward to the update.
     
  24. Dreamteck

    Dreamteck

    Joined:
    Feb 12, 2015
    Posts:
    336
    Just wanted to let everyone know that we now have a public Discord and everyone who needs help using Dreamteck Splines can request a "Fellow Developer" role and have a realtime chat with us and the rest of the community:
    https://discord.gg/bkYDq8v
     
  25. Dreamteck

    Dreamteck

    Joined:
    Feb 12, 2015
    Posts:
    336
    Version 1.0.9 is the new major update which redefines the way meshes are generated. It introduces the new and powerful Spline Mesh component which allows for the construction of complex meshes that consist of various elements. The performance of all mesh generators has been improved and GC has been reduced.
     
    Fantilyre and sjm-tech like this.
  26. barker_s

    barker_s

    Joined:
    Jul 17, 2012
    Posts:
    29
    Hello!

    I've had your asset in my sights fore some time now and finally bought it during the current sale.

    After a quick look at the tutorials and the documentation I can say that I am very pleased with my purchase - it looks feature-rich and professional. Having said that, there's one very specific thing that I'd like to achieve and I was wondering if it's possible at all?

    What I'd like to do, is to find the distance in a straight line from an arbitrary point in world space to the spline (and not just the control-point, but the actual spline point). Bonus points if I could also determine on which side of the spline said point resides (I know splines do not technically have "sides", but if you run a spline across a plane and assume that there's a beginning and end to the spline, the plane would be divided into left and right portion in reference to the spline). It would be enough for my use-case if these calculations operated in 2d space (as in, the point and the spline shared their Z level).

    Sorry if that's a little convoluted, maybe a simple scenario will clear things up. What I'm hoping to achieve is to have a spline situated across a plane, which would represent a river and then displace the plane's vertices according to the distance. I'd like to do the same for coastlines, except it would then only displace vertices on the specified "side" of the spline.

    So, would such a thing be possible with Dreamteck Splines? I did search the API documentation, but couldn't find anything similar.
     
  27. Dreamteck

    Dreamteck

    Joined:
    Feb 12, 2015
    Posts:
    336
    Hi and thank you for your interest in Dreamteck Splines!
    Yes, this is absolutely possible and is pretty easy. Here is how you can do it given you have a reference to the SplineComputer component:

    SplineComputer spline = GetComponent<SplineComputer>();

    double projectedPercent = spline.Project(yourWorldPoint); //Find the percent along the spline closest to that world point
    SplineResult projectedResult = spline.Evaluate(projectedPercent); //Evaluate the spline at that percent
    float distance = Vector3.Distance(yourWorldPoint, projectedResult.position);
    Vector3 directionToPoint = (yourWorldPoint-projectedResult.position).normalized;
    float dot = Vector3.Dot(directionToPoint, projectedResult.right);

    if(dot > 0f) // point is on the right
    if(dot < 0f) //point is on the left

    To summarize - you only need to use Project and Evaluate - the rest is just some simple linear algebra using the Unity API :)

    Additionally, if you use the SplineProjector component, then in order to get the projected result you just do this:

    GetComponent<SplineProjector>().result.position;
     
    barker_s likes this.
  28. barker_s

    barker_s

    Joined:
    Jul 17, 2012
    Posts:
    29
    Amazing :) . Thank you very much, you've made my day :) .
     
  29. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,027
    Is there a way to make my objects rotate to the curvature of a spline when it's moving along the spline? I used to use Curvy and it had a feature called something like follow curvature and as my ships followed the spline they would bank around curves based on normals along the spline. I haven't found a way to do this in Dreamteck yet.
     
  30. Dreamteck

    Dreamteck

    Joined:
    Feb 12, 2015
    Posts:
    336
    You can either do this by rotating the spline normals or if you want this to be done automatically, you can write up a small piece of code which can offset your follower's rotation along the spline.

    In order to write your own solution, you need to sample the spline at at least 3 points. One at the position of the follower, one behind it and one in front it. Let's call these three points A (behind), B (current) and C (in front). You need to calculate the signed angle between the vectors AB and CB. You can t hen use this angle to tilt the follower.
    Vector3.SignedAngle(AB, CB, follower.result.normal);

    We are planning to add a built-in functionality for banking in an upcoming version.
     
  31. Dreamteck

    Dreamteck

    Joined:
    Feb 12, 2015
    Posts:
    336
     
  32. waqarshah

    waqarshah

    Joined:
    May 9, 2018
    Posts:
    3
    this is a great plugin and it saved my lot of time. I am developing endless road game like voodoo color road. I am generating path from code. For path rendering I am using Path Generator. There is a problem with path generator or may be I am doing something wrong. Path generator always render some part of spline, no mater what length is of path.I am attaching splines path screenshot. Your help is really appreciated. thanx
     

    Attached Files:

  33. wmaass88

    wmaass88

    Joined:
    Dec 23, 2012
    Posts:
    45
    I am using SplineMesh to place a bunch of spheres with point lights attached along a a spline. I want to turn the lights on and off and swap materials for the spheres in sequence, like runway lights. Is there a way to access the transform of each placed mesh in a channel?
     
  34. Dreamteck

    Dreamteck

    Joined:
    Feb 12, 2015
    Posts:
    336
    This is the editor visualization of the spline - this is not visible in runtime so you don't have to worry about it. Additionally, you can toggle off the draw thickness for the spline to disable the thickness drawing and display the spline as a thin curve.
     
  35. Dreamteck

    Dreamteck

    Joined:
    Feb 12, 2015
    Posts:
    336
    The Spline Mesh component does not create separate objects for each mesh. All meshes inside the Spline Mesh component share the same transform. If you have pulled the meshes from a prefab with lights, the lights will not be included in the Spline Mesh either. You would need the Object controller if you want to spawn prefabs with lights along the spline. Then you can get the lights using GetComponentsInChildren<Light>() or by iterating through the children like:
    foreach(Transform child in transform) ... get the light of each child.
     
  36. wmaass88

    wmaass88

    Joined:
    Dec 23, 2012
    Posts:
    45
    Great! Thanks for the tips. Your asset is among my most favorites, thanks a lot!
     
    Dreamteck likes this.
  37. wmaass88

    wmaass88

    Joined:
    Dec 23, 2012
    Posts:
    45
    Yep works great!
     
    Dreamteck likes this.
  38. Boolai

    Boolai

    Joined:
    Nov 13, 2014
    Posts:
    9
    Is there a way I can add more vertices in the tube generator? I have a tube and a vehicle inside the tub.e it uses raycasting to the get normal of the tub. But need more vertices so that it goes smooth.
     
  39. JLO

    JLO

    Joined:
    Nov 11, 2012
    Posts:
    46
    @Boolai If you insert more points in your spline you can increase the density of the tubes mesh.
    The tube on the left only has 2 points, while the tube on the right has 8 points and it makes the mesh more dense.
    Hopefully this is what your looking for.

    tube1.PNG tube2.PNG
     
    Dreamteck likes this.
  40. waqarshah

    waqarshah

    Joined:
    May 9, 2018
    Posts:
    3
    is there a way to lock spline follower position at left most while spline size is changing randomly.
     
  41. Dreamteck

    Dreamteck

    Joined:
    Feb 12, 2015
    Posts:
    336
    Not sure I understand the question completely. Can you tell me more about your setup? I understand, you have a spline that you are resizing and you want the follower to stay in the same world space coordinates while doing so?
    You can try calling the project method and setting the result as a percent for the follower after each frame you resize the spline in:
    - Change the spline
    follower.SetPercent(follower.computer.Project(follower.transform.position));
     
  42. dheerajemilence

    dheerajemilence

    Joined:
    Oct 16, 2017
    Posts:
    1
    Hi there,I've purchased this plugin and using it in my game, I am generating path an applying texture to it . It works for some of them but not all. Is there any way to modify my path. Because i am making a game which constitutes of different types of paths.
     
  43. shellyalon

    shellyalon

    Joined:
    Mar 26, 2013
    Posts:
    27
    Hej <3
    I've started using this plugin and it's great! Thank you very much.
    I've encoutered just a minor problem and maybe you could help me?

    I'm trying to build some kind of snake. I'm extruding stuff for the body but for the head and tail I'd like to use two spheres (or other meshes) as caps. But when the channel type is on 'Place' instead of 'Extrude' vertex color doesn't seem to work. Is this a bug or a feature? Can I change this somehow so that the placed meshes will also listen to the vertex color? Is there a workaround for what I am trying to achieve?

    I basically want all the channels to be rendered by one material. I'm no expert in shaders and materials and stuff, so go easy on me.

    Thanks

    1.PNG 2.PNG 3.PNG
     
  44. Dreamteck

    Dreamteck

    Joined:
    Feb 12, 2015
    Posts:
    336
    Hi! Thank you for using Dreamteck Splines!

    Oh, this seems like a bug. I will take a look at it and resolve it on Monday if that's okay. Can you please send us a message at support@dreamteck.io so that we can send you a fix as soon as we have the patch so you don't have to wait for the new update to roll out? :)
     
  45. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    438
    Hello,

    Any reason why my email has not been responded yet?

    Should I ask the question(s) elsewhere?

    In the past I've gotten the responses but now nothing...
     
  46. Dreamteck

    Dreamteck

    Joined:
    Feb 12, 2015
    Posts:
    336
    Apologies for the inconvenience.

    We had some issues with our inbox quota being full and some messages might have not reached the server. Try re-sending the message now, we should be now able to receive it. Just make sure that attached content is below 25MB

    Also, make sure you are sending your messages to support@dreamteck.io and not our old domain - dreamteck-hq.com
     
  47. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    438
    Okay, yes they are small emails and its a continued conversation on the email provided indeed,

    This is new:

    I installed Latest Unity 2017.4.3f1 and I cannot build my project with Dreamteck inside, I have to completely remove it...
    NOTE: This happens after I import it into my project without having any splines etc within any of my scenes.

    This is the error:


    Assets/Dreamteck/Splines/Components/MeshGenerator.cs(304,55): error CS0103: The name `AssetDatabase' does not exist in the current context
     
  48. Dreamteck

    Dreamteck

    Joined:
    Feb 12, 2015
    Posts:
    336
    We pushed a fix for this to the Asset Store and hope will be live soon. Send us an e-mail and we can send you the fix so you don't have to wait for the new version.
     
  49. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    438
    Okay,

    Just waiting for email responses on my previous inquires first...
     
  50. Dreamteck

    Dreamteck

    Joined:
    Feb 12, 2015
    Posts:
    336
    The new version is live on the Asset Store.
    We don't have any unanswered messages in support@dreamteck.io You will need to re-send them unfortunately.