Search Unity

Dreamteck Splines - Powerful and Flexible Spline Solution

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

  1. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    I'm considering getting this asset for a simple road system. An important aspect of this are junctions - unfortunately, the documentation a little sparse in that regard. It seems like there's a functionality for junction prefabs with connection points, could you perhaps briefly explain how that is supposed to work? And I'm assuming I would need to write a small editor extension myself to determine which intersection asset to use, depending on number of splines, angles etc. Can that information be obtained relatively easily from your API? I see the documentation referencing a SplineTracer class, but that does not appear to be covered in the .PDF API reference.

    Also, how much memory allocation would be expected for sampling a spline once?

    And lastly, out of curiosity: Are there any plans to use DOTS for improving performance some time in the future?
     
    Last edited: Jul 23, 2020
    LudiKha likes this.
  2. D_Cergy

    D_Cergy

    Joined:
    Feb 18, 2015
    Posts:
    35
    Hi,

    Having read HQF's comment, I take a look and found that the scenes that contains spline in it has a significant increase in size
    SplineSize.png
    The first scene contains a 700kb prefab, I think the 10kb is only the size of a reference link to the prefab asset and scene settings.
    The other scene contains Spline has a reference to a 200kb prefab object and should be 10kb as well, but it shows 6.1MB instead. Does it affect significantly to the size of the release build?


    Another question,
    Screen Shot 2020-07-27 at 16.10.50.png
    I made levels with modular prefab meshes without any terrain. I came into this issue when I try to snap the road to sloping ground. I tried various settings but nothing give me the result. Usually I use B Spline or Bezier, as it gives nice smooth rounded meshes, but it averaging themself in slopes causing it didn't snapped correctly to the ground at elevation change. So I tried the linear mode, but it also has some twist in a node normal. And in certain angles, some of road width looked squeezed badly and don't have consistent width. The UV is also not proportionally sized in Default Sample mode, the Uniform and Optimized solve it, but it generates different mesh shape and often times is way too off from its node position.

    Screen Shot 2020-07-27 at 16.59.37.png
    This image is using the Linear and Uniform sample mode.

    Another issue is, I experience a very laggy editor while selecting objects containing Spline Mesh. It solved when I disable the Spline Mesh component. Any suggestion to solve these issues?
     
  3. HQF

    HQF

    Joined:
    Aug 28, 2015
    Posts:
    40
    Yes it does.. that's why I wrote this. I hope dreamteck will fix it.
     
    D_Cergy likes this.
  4. FutureSystems

    FutureSystems

    Joined:
    Aug 21, 2019
    Posts:
    19
    Hi I am getting IndexOutOfRangeException Error. error splines.JPG Could you please help me to resolve it?
     
  5. x_ming_x

    x_ming_x

    Joined:
    Jan 1, 2013
    Posts:
    46
    Hello All
    Im trying to generate a spline at runtime and cannot work out how add points to the spline via script. Is this possible? any help would be much appreciated
    Cheers
     
  6. Denis1122

    Denis1122

    Joined:
    Jan 6, 2020
    Posts:
    9
    Hi all!
    How can i find intersection of two splines?
    Now i iterate on first, and find projections on second spline. Minimal projection is closest point to intersection.
    Is DreamteckSplines have a easiest way for find spline crossings?
     
    one_one likes this.
  7. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    I don't think there is, unless you add a junction at the intersection.
     
  8. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    605

    I often end up with splines twisting, especially when using the snap to grid. Is there any way to prevent this?
     
  9. Denis1122

    Denis1122

    Joined:
    Jan 6, 2020
    Posts:
    9
    How remove all points at runtime (script) from SplineComputer?
     
    Last edited: Aug 18, 2020
  10. Dreamteck

    Dreamteck

    Joined:
    Feb 12, 2015
    Posts:
    336
    Hi Guys, version 2.03 is live on the Asset Store!
    We focused on fixing issues for this one rather than introducing new features.
    Here is the list of things:

    We are still figuring out why scenes have such a big file size for some of you. Any feedback on how we can reproduce that from scratch in an empty scene would be greatly appreciated (use our support form: https://dreamteck.io/support/contact.php).

    To answer latest inquiries:

    @x_ming_x yes, this is possible, check out the examples coming with the project and our manual: https://dreamteck.io/page/dreamteck_splines/user_manual.pdf

    @Denis1122 This unfortunately isn't a trivial task and in 3D is much more complex than in 2D. We don't have a built-in way to do such thing but if you're using 2D, you can go through the splines sample by sample and check for intersection between any two samples of the two splines. To remove all points: spline.SetPoints(new SplinePoint[0]);

    @dock This is an issue with the spline normals. You can fix this by selecting the points, going to the normal tool, expanding the normal operations dropdown and selecting "Perpendicular To Spline"
     
  11. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,618
    I'm currently evaluating Rider and its analyzer points to some inefficiencies in
    SampleCollection
    , for example:

    upload_2020-8-27_9-3-44.png

    Rider says it's more efficient when changed to:
    upload_2020-8-27_9-4-3.png

    Might be worth to change all those occurrences, as it should half vector multiplications, which could be a nice improvement in all those
    while
    loops.
     
    Dreamteck likes this.
  12. Dreamteck

    Dreamteck

    Joined:
    Feb 12, 2015
    Posts:
    336
    Good point! Will make sure to change this in 2.04.
     
    Peter77 likes this.
  13. Freznosis

    Freznosis

    Joined:
    Jul 16, 2014
    Posts:
    298
    Is there any way to get meshes to be evenly placed along a spline? I know I could just write my own script to do this but I am wondering if Spline Mesh is capable of this?

    Unity_2020-08-29_22-11-19.png

    The left is Dreamteck Splines with just using "Auto Count", the right is an alternate spline solution.

    I need to be able to adjust the clip range of the sleepers (wood below rail) so I can't include it in the main mesh. Even if I could, the main mesh has this same problem of being very dense in curves.
     
  14. Dreamteck

    Dreamteck

    Joined:
    Feb 12, 2015
    Posts:
    336
    If you set the spline's sample mode to Uniform, then they will be uniformly placed along the spline.
     
    Freznosis likes this.
  15. toto2003

    toto2003

    Joined:
    Sep 22, 2010
    Posts:
    528
    Hello dreamteck, i try to build for windows universal platform, but i got theses error Assets\Dreamteck\Splines\Core\SplineThreading.cs(21,28): error CS0103: The name 'threads' does not exist in the current context
    will splines would be compatible in the future?
    same goes to forever toolkit as i can t build with this asset.
    thanks
     
  16. vorp

    vorp

    Joined:
    Aug 30, 2013
    Posts:
    10
    Just bought and am enjoying Dreamteck Splines 2.3.0 but I'm running into an issue where I can't set up triggers on Spline Follower game objects. I've checked Use Triggers and set a Trigger Group but no "Add Trigger" button appears and I'm left with no idea of how to proceed.
    I can create triggers on my Spline Computer component but that's not what I'm after as I want each follower to respond to reaching the end of the spline.
    The instructions in the manual seem clear enough I'm just not seeing any way to add triggers on the Spline Follower.
    I've attached an image of what I see in the interface in Unity 2020.1.2f1 on Mac.
    Please advise. Thanks.
     

    Attached Files:

  17. harringtonsp

    harringtonsp

    Joined:
    Apr 2, 2017
    Posts:
    6
    Hi Dreamteck, I'm trying to use Nodes as Junctions for a grid of spline computers. I'm trying to add a custom OnJunction event per the Train Examples, but my custom event isn't firing. I'm subscribing with _tracer.onNode += OnJunction;

    The only thing I can think is that my Node is connecting the first point of a spline to the last point of another spline, so when the Follower reaches the node, it may not "pass by" the node as the documents say. Am I correct?
     
  18. harringtonsp

    harringtonsp

    Joined:
    Apr 2, 2017
    Posts:
    6
    @vorp Instead of triggers, try creating a Monobehavior then adding a method to the delegate onBeginningReached and onEndReached

    Code (CSharp):
    1.   private SplineFollower _follower = null;
    2.     void Start ()
    3.     {
    4.         _follower = GetComponent<SplineFollower> ();
    5.         _follower.onBeginningReached += onBeginningReached;
    6.         _follower.onEndReached += onEndReached;
    7.     }
    8.     void onBeginningReached (double percent)
    9.     {
    10.         Debug.Log (transform.position);
    11.     }
    12.     void onEndReached (double percent)
    13.     {
    14.         Debug.Log (transform.position);
    15.     }
     
    vorp likes this.
  19. ScottJak

    ScottJak

    Joined:
    Jul 23, 2020
    Posts:
    7
    Hello,

    I get an index out of range exception in SplineMesh.cs (I believe because I have a spline with more than 1 channel) and need to add the following at ~ line 127: combineMeshes.AddRange(new TS_Mesh[channels.count - 1]);

    Not sure if I'm doing something wrong elsewhere that's causing this issue, but just thought I'd share.

    Edit:
    Issue only occurs when you have autoCount selected and the real fix is to take the old channels.count, compare it to the new one, and add/subtract from combineMeshes accordingly.
     
    Last edited: Dec 3, 2020
  20. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,618
    How can I avoid that the mesh generated by the "Path Generator" Component has these overlaps?

    upload_2020-9-9_10-33-41.png
     
    one_one likes this.
  21. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,618
    I'm trying to generate a border on each side of my main path. However, since I have to specify the Offset using world-units, I don't seem to be able to generate the border appropriately along the wider main path.

    How can I generate a border at each side that respects the main path width?

    upload_2020-9-9_11-51-35.png
     
    one_one likes this.
  22. Pourya-MDP

    Pourya-MDP

    Joined:
    May 18, 2017
    Posts:
    145
    Hello there
    Im trying to create a endless racer game for android
    Im playing with this asset for almost 4 days now and its great
    I have a question and i hope i will get helpfull answers.
    Alright let me explain it instead of asking like a question
    I want to add a functionallity to follower component which will allow me to move player (gameobject which the follower component attached to) to left and right smoothely along the spline,but with a limit which is the length of the road we created on the spline (scale of the road from left to right)
    Any helps are appreciated
     
  23. HQF

    HQF

    Joined:
    Aug 28, 2015
    Posts:
    40
    so many ways, here is two:
    1) Move parent transform with spline follover and move child transform with your object in local/world position relative to parent pos.
    2) change offset in spline follower
     
    Pourya-MDP likes this.
  24. Pourya-MDP

    Pourya-MDP

    Joined:
    May 18, 2017
    Posts:
    145
    I chose second method but it seems complicated because ita just working for one side for example only right or left
    Should i create 2 offset??
     
  25. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    605
    That's excellent, thanks for the reply!!
    Dreamteck Splines is really fantastic btw, thanks for making it and providing such good support.
     
    Dreamteck likes this.
  26. Dreamteck

    Dreamteck

    Joined:
    Feb 12, 2015
    Posts:
    336
    Unfortunately there is no way to avoid geometry being intersected at sharp turns. You need to either open up the turn or make the path narrower at that point.

    The offset is also not multiplied by the size of the path. We can add a checkbox to toggle this on and off.
     
  27. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,618
    That would be quite useful.
     
  28. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    605
    Any idea what's happening with my Spline Computer when I select Spline Primitives?
    Code (CSharp):
    1. NotSupportedException: The invoked member is not supported in a dynamic module.
    2. System.Reflection.Emit.AssemblyBuilder.GetExportedTypes () (at <fb001e01371b4adca20013e0ac763896>:0)
    3. Dreamteck.FindDerivedClasses.GetAllDerivedClasses (System.Type aBaseClass, System.String[] aExcludeAssemblies) (at Assets/ThirdParty/Dreamteck/Utilities/Editor/FindDerivedClasses.cs:38)
    4. Dreamteck.FindDerivedClasses.GetAllDerivedClasses (System.Type aBaseClass) (at Assets/ThirdParty/Dreamteck/Utilities/Editor/FindDerivedClasses.cs:48)
    5. Dreamteck.Splines.Editor.PrimitivesModule.LoadPrimitives () (at Assets/ThirdParty/Dreamteck/Splines/Editor/SplineEditor/DS Editor/PrimitivesModule.cs:197)
    6. Dreamteck.Splines.Editor.PrimitivesModule.Select () (at Assets/ThirdParty/Dreamteck/Splines/Editor/SplineEditor/DS Editor/PrimitivesModule.cs:69)
    7. Dreamteck.Splines.Editor.SplineEditor.ToggleModule (System.Int32 index) (at Assets/ThirdParty/Dreamteck/Splines/Editor/SplineEditor/SplineEditor.cs:363)
    8. Dreamteck.Splines.Editor.SplineEditor.DrawToolMenu () (at Assets/ThirdParty/Dreamteck/Splines/Editor/SplineEditor/SplineEditor.cs:224)
    9. Dreamteck.Splines.Editor.SplineEditor.DrawInspector () (at Assets/ThirdParty/Dreamteck/Splines/Editor/SplineEditor/SplineEditor.cs:195)
    10. Dreamteck.Splines.Editor.DreamteckSplinesEditor.DrawInspector () (at Assets/ThirdParty/Dreamteck/Splines/Editor/SplineEditor/DS Editor/DreamteckSplinesEditor.cs:133)
    11. Dreamteck.Splines.Editor.SplineComputerEditor.OnInspectorGUI () (at Assets/ThirdParty/Dreamteck/Splines/Editor/SplineComputerEditor.cs:185)
    12. UnityEditor.UIElements.InspectorElement+<>c__DisplayClass58_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <fd8fd784002f49beab0500d3a24213b9>:0)
    13. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    14.  
    15.  
    16. NullReferenceException: Object reference not set to an instance of an object
    17. UnityEditor.EditorGUIUtility.TempContent (System.String[] texts) (at <fd8fd784002f49beab0500d3a24213b9>:0)
    18. UnityEditor.EditorGUI.Popup (UnityEngine.Rect position, System.Int32 selectedIndex, System.String[] displayedOptions, UnityEngine.GUIStyle style) (at <fd8fd784002f49beab0500d3a24213b9>:0)
    19. UnityEditor.EditorGUILayout.Popup (System.Int32 selectedIndex, System.String[] displayedOptions, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at <fd8fd784002f49beab0500d3a24213b9>:0)
    20. UnityEditor.EditorGUILayout.Popup (System.Int32 selectedIndex, System.String[] displayedOptions, UnityEngine.GUILayoutOption[] options) (at <fd8fd784002f49beab0500d3a24213b9>:0)
    21. Dreamteck.Splines.Editor.PrimitivesModule.PrimitivesGUI () (at Assets/ThirdParty/Dreamteck/Splines/Editor/SplineEditor/DS Editor/PrimitivesModule.cs:119)
    22. Dreamteck.Splines.Editor.PrimitivesModule.DrawInspector () (at Assets/ThirdParty/Dreamteck/Splines/Editor/SplineEditor/DS Editor/PrimitivesModule.cs:104)
    23. Dreamteck.Splines.Editor.SplineEditor.DrawInspector () (at Assets/ThirdParty/Dreamteck/Splines/Editor/SplineEditor/SplineEditor.cs:198)
    24. Dreamteck.Splines.Editor.DreamteckSplinesEditor.DrawInspector () (at Assets/ThirdParty/Dreamteck/Splines/Editor/SplineEditor/DS Editor/DreamteckSplinesEditor.cs:133)
    25. Dreamteck.Splines.Editor.SplineComputerEditor.OnInspectorGUI () (at Assets/ThirdParty/Dreamteck/Splines/Editor/SplineComputerEditor.cs:185)
    26. UnityEditor.UIElements.InspectorElement+<>c__DisplayClass58_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <fd8fd784002f49beab0500d3a24213b9>:0)
    27. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    28.  
    29.  
    upload_2020-9-15_15-11-54.png
     
  29. biscito

    biscito

    Joined:
    Apr 3, 2013
    Posts:
    138
    hi

    is it possible to move a train following a path it with timeline ? or to generate a path using cinemachinepath ?

    for cut scene

    redit :
    found it ! it's spline positioner !!! perfect !!!
     
    Last edited: Sep 16, 2020
  30. Pourya-MDP

    Pourya-MDP

    Joined:
    May 18, 2017
    Posts:
    145
    Hello there i tried to create a junction and connect two splines every thing is good except that the player wont switch to other spline as it passes the node
    I did exactly what you told in docs but no luck
    The debug.log will be trigged but no change on player path and player will stop there (on nodes position)

    20200916_134059.jpg

    Heres the secen i created

    Edit:after 9 hours of struggling i found out that we should select the loop mode on the splines follower wrap mode
    Please note it on new docs
    Thanks in advance
     

    Attached Files:

    Last edited: Sep 16, 2020
  31. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,618
    All spline-point handles that I used to manipulate points disappeared.

    When I switch to edit mode, I normally see all the points that I can select and move around to modify the spline. However, these are gone now. This affects all splines in the project. Additionally, I also don't see the spline visualization anymore unless I select "Always draw spline".

    What could cause this problem?



    The gizmos are all enabled:
    upload_2020-9-17_9-1-39.png
     
    Last edited: Sep 17, 2020
  32. Dreamteck

    Dreamteck

    Joined:
    Feb 12, 2015
    Posts:
    336
    Try resetting the editor layout. This is sometimes known to help but I'm not sure what it is caused by exactly in the first place.
     
  33. Dreamteck

    Dreamteck

    Joined:
    Feb 12, 2015
    Posts:
    336
    We are issuing a fix for this soon!
     
    Malveka likes this.
  34. Anikki

    Anikki

    Joined:
    Dec 23, 2012
    Posts:
    8
    Bugfix for Dreamteck Splines v2.0.3

    In SplineMesh.cs starting at line 130 inside the Generate() method, the following code produces a stack overflow from recursively calling Rebuild() when the property Channel.count is set to 0 and immediately changed to 1 in the next line.

    Code (CSharp):
    1.  
    2. if(avgBounds > 0f)
    3. {
    4.     float length = CalculateLength(channels[i].clipFrom, channels[i].clipTo);
    5.     channels[i].count = Mathf.RoundToInt(length / avgBounds);
    6.     if (channels[i].count < 1)
    7.         channels[i].count = 1;
    8. }
    9.  
    For me, the following change fixed the issue:

    Code (CSharp):
    1.  
    2. if(avgBounds > 0f)
    3. {
    4.     float length = CalculateLength(channels[i].clipFrom, channels[i].clipTo);
    5.     var count = Mathf.RoundToInt(length / avgBounds);
    6.     channels[i].count = Mathf.Clamp(count, 1, int.MaxValue);
    7. }
    8.  
     
  35. Malveka

    Malveka

    Joined:
    Nov 6, 2009
    Posts:
    191
    Update Oct. 9, 2020: The Tools window is now appearing properly with version 2.04. Thanks for the fix!

    Update: Though I previously searched for the console error message in this thread, the post just up the page by 'dock' and replied to by Dreamteck was not found. Oops. I'm guessing my issue has the same underlying cause, though the symptoms are different.


    Just purchased Dreamteck Splines and so far, generally speaking, I like what I see. An exception to this is that I am seeing an empty window when I attempt Window->Dreamteck->Splines->Tools and multiple errors in the console. One of the first things I wanted to try was importing from an SVG. :confused:

    Screenshot attached. I'm using Unity Version 2019.4.6f1. It appears there is an error in the use of Reflection. Any insights? Thanks.
     

    Attached Files:

    Last edited: Oct 9, 2020
  36. vorp

    vorp

    Joined:
    Aug 30, 2013
    Posts:
    10
    Thanks for the response @harringtonsp
    Unfortunately I don't see how that will help me create triggers anywhere within the spine that my followers can directly respond to.
    Unless there's another built-in alternative, I think I'm going to make lastClippedPercent public inside SplineFollower and just have my followers test it occasionally.
     
  37. unrealy

    unrealy

    Joined:
    Jun 26, 2020
    Posts:
    1
    Hello, a few months ago I acquired Dreamteck Splines, I am very happy with the tool.

    I have a problem and I need your help.

    I need two splines each with an object, one of them is engine and the other a wagon and an offset. I do not know if I explain myself.

    I include image of the case.
    Thanks.

    PS: I have already sent the query to support, but I put it here in case someone has the same problem
     

    Attached Files:

  38. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,618
    The problem is that
    SplineEditor.editMode
    never stays
    true
    .

    Pressing the "Edit" button does set editMode to true:
    Code (CSharp):
    1. if (GUILayout.Button("Edit"))
    2. {
    3.     editMode = true;
    4. }
    ... however, it's set to
    false
    again by:
    Code (CSharp):
    1. protected override void Load()
    2. {
    3.     base.Load();
    4.     editMode = EditorPrefs.GetBool(GetSaveName("editMode"), false);
    5.     pointToolsToggle = EditorPrefs.GetBool(GetSaveName("pointToolsToggle"), false);
    6. }
    The fix to this issue seems to be to save after pressing "Edit":
    Code (CSharp):
    1. if (GUILayout.Button("Edit"))
    2. {
    3.     editMode = true;
    4.    Save();
    5. }
    ... this causes the handles to appear again.
     
  39. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    605
    upload_2020-10-22_16-37-41.png

    Is there any way to prevent Spline Mesh from generating new smoothing groups?
    The example on the right is how it should appear.
    I've tried both Spline Normals and Recalculate Normals, but that doesn't fix it.
     
  40. Deleted User

    Deleted User

    Guest

    Tried your fix; doesn't work ... Unity 2020.1.8f1, DreamTeck Spline 2.0.5
     
  41. Deleted User

    Deleted User

    Guest

    So ... package is broken in 2020.1 ... @Dreamteck ?
     
  42. timmehhhhhhh

    timmehhhhhhh

    Joined:
    Sep 10, 2013
    Posts:
    157
    Same issue here - @Dreamteck looking into this for a road system, what's a recommended approach for junctions / intersections.
     
  43. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    I ended up writing a small 'network builder' script that builds up a node graph from splines connected via junctions. I then built some small custom A* pathfinding based on path length between junctions on top of that. Gameplay wise, that's enough for my needs, at least for now.
    There's still two major issues I need to look into, though. One is the authoring, setting up junctions is really tedious. I'll probably have to write a small editor script for that, perhaps inspired by road building in Cities: Skylines.
    The second part is the visual aspect of intersections and transitions between road types. For anything more than right-angle T and X intersections that can be faded out towards the ends, some sort of junction 'background' will be needed, that will also need to be deformable based on angles and terrain. I've yet to come up with a good solution for this, one potential idea was to deform the junctions via bones for each entry where a road would be attached.
     
    timmehhhhhhh likes this.
  44. MuhammadMomin

    MuhammadMomin

    Joined:
    Dec 16, 2019
    Posts:
    3
    Hi, The spline plugin is good. I am stuck in some collider issue. I have created a random track using your spline and move a car along it. I am not using spline follower component to move my car. I want the spline in that way that it has colliders in the edges of the road so that my car would not fall from the spline track. There is one solution in my mind is to export the track in blender and add invisible mesh along the edges of the spline and then import it to Unity but I don't want to use this method. Is there any other way of doing this? if so please tell. I am in the middle of my project. Thanks.
     
  45. Dreamteck

    Dreamteck

    Joined:
    Feb 12, 2015
    Posts:
    336
    @one_one @tbriley
    When using a Spline Tracer component (Follower, Projector or positioner) you get the onNode event. If you subscribe to it, you will get a callback every time the tracer passes a Node. Using the Node API you can get a list of all connected splines including info at which point they are connected. You can cycle through them to pick the best connection based on custom logic or you can add an additional component to the Node object which would say which connection is the active one, etc.
     
    timmehhhhhhh likes this.
  46. Dreamteck

    Dreamteck

    Joined:
    Feb 12, 2015
    Posts:
    336
    Currently running Dreamteck Splines 2.06 on 2020.1 with no issue. Do you get any errors or anything that we can use to figure out what is the issue you are having?
     
  47. Dreamteck

    Dreamteck

    Joined:
    Feb 12, 2015
    Posts:
    336
    Unfortunately this is not an easy task - to intersect two or more spline meshes seamlessly while handling UVs, etc. The usual approach is to use pre-made geometry and connect to it using Nodes but then it isn't deformable in runtime nor the editor.
     
  48. Dreamteck

    Dreamteck

    Joined:
    Feb 12, 2015
    Posts:
    336
    You can create two additional path generator objects, set their rotation to 90 and -90, set the desired offset for them, add a mesh collider to them and disable the renderer.
     
  49. marcrem

    marcrem

    Joined:
    Oct 13, 2016
    Posts:
    340
    We use Dreamteck Splines in our project and their documentation is actually pretty complete, but it's a spline tool with an API, not a road tool with road-specific functions.

    So here's some example of what we did.

    First of all by sampling the Spline Computer component and its Spline Mesh component, we terraform our terrain to fit our roads:


    Then we made our own connector component that will get the closest spline point and make it fit to the chosen connector + terraform the terrain, all at once :


    So really, you can do pretty much anything with this tool. We also have a tool that populates grass procedurally for us, and it samples our splines to make sure it doesn't spawn grass on our roads.
     
  50. marcrem

    marcrem

    Joined:
    Oct 13, 2016
    Posts:
    340
    Sorry for double posting in this thread, but It's another topic.

    @Dreamteck , it appears that when duplicating a GameObject containing a spline, and moving the Transform of this GameObject, will create some weird behaviour in the splines. Usually it'll look good, then if you unload the scene and load it again, your newly duplicated spline will be either gone, or somewhere else.

    Then, simply by clicking on the GameObject to select it in the hierarchy, boom, the spline mesh gets updated and it's at the right place again.

    However, it seems something is not marked dirty or something else. Often when doing other tasks, the previously duplicated roads will break again, forcing us to select each problematic spline to "refresh" their meshes again.

    I tried calling RebuildImmediate(true, true) on the spline computer, but it doesn't seem to fix my issue.