Search Unity

[RELEASED] Ultimate spline solution

Discussion in 'Assets and Asset Store' started by Raed_Abdullah, Aug 5, 2014.

  1. Raed_Abdullah

    Raed_Abdullah

    Joined:
    Aug 5, 2014
    Posts:
    50
    best way to create paths and splines for objects to move on !!
    you can create any path within minutes.



    key features :
    *
    Drawing splines just buy ctrl+left clicking in the editor
    *Well optimized ( just 1 object per spline )
    *You can create splines with crosses and multiple ways and the object can choose its way using player input or randomly or custom script
    *You can call methods when reaching a specific point (no more triggers)
    *Full heavy commented source code
    *Bezier curves

    Usability :
    i tend to use this tool a lot in my project
    here is some of cool things you can make with it
    _ particle effect movement
    _ AI path following (my tool with unity nav mesh for the Ultimate combo)
    _ real time spline creation (this is hard at this time but I will make the API more friendly in future updates)
    _ simply any 3D game with any character that moves automatically its great to use this tool

    for any feedback you can send me an email or post it here I will be more than happy to answer

    and if you have any ideas for tutorials I will do my best to make it

    UPDATE 1.2 IS AVAILABLE
    price : 5$

    will be update with more features in the future to make it better and better !!

    asset store link :
    https://www.assetstore.unity3d.com/en/#!/content/20200
     
    Last edited: Dec 14, 2014
  2. Raed_Abdullah

    Raed_Abdullah

    Joined:
    Aug 5, 2014
    Posts:
    50
    Update in progress
    adding save as button to the tool bar
     
  3. Sailendu

    Sailendu

    Joined:
    Jul 23, 2009
    Posts:
    254
    Please post a video or webplayer demo of it, so we can see how it's working.
     
  4. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,293
    Hi, i have bought and played a little with it.
    So far it is nice.
    Do you have an example where dependend on the value of a variable the player choose the left or the right spline?
    Like in a game, when the player have enough points he takes the left way otherwise the right one.

    Also, can let a spline come back to the root spline?
    Meaning if i have a big root spline as a loop, the player then comes to the first subspline, if he has enough points he takes the subspline otherweise he stays on the root spline. If i allowed to take the root spline, the end of the spline should then come back to the main spline where he ride for a while and comes to the second subspline. Once again, if he have enough pints, he takes the second subspline, that comes back later to the root spline and at the end of the second subspline he comes back to the root spline.

    I hope you can understand what i mean ;)
    It would be nice if you can show me on how to reach this goal with your nice little asset.
     
  5. Raed_Abdullah

    Raed_Abdullah

    Joined:
    Aug 5, 2014
    Posts:
    50
    Ah I'm so sorry for late reply :(
    thank you very much for buying my tool :D

    here is a video tutorial for how to deal with your case




    ;)
     
  6. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,293
    Thank you Raed_Abdullah,

    i can definetly use that information on that video.
    So what i can not see is can i come back from the second spline to the first and then go further on the first spline until the next, third, spline choice?
     
  7. Raed_Abdullah

    Raed_Abdullah

    Joined:
    Aug 5, 2014
    Posts:
    50
    I think you can make it with the draw line tool
    between the end of your second spline and the point you want to go back at it in the main spline
    if that dosen't help please tell me ;)
     
  8. Sailendu

    Sailendu

    Joined:
    Jul 23, 2009
    Posts:
    254
    Thanks for posting the video, now I can understand the functionality.
     
  9. Raed_Abdullah

    Raed_Abdullah

    Joined:
    Aug 5, 2014
    Posts:
    50
    you're welcome :D

    here is an information about the next update

    fixed moving errors
    added a new shortcut
    G : to snap the selected point to the ground

    added a new button :


    this button will snap all the points to the ground

    like shown in the picture

    added a new feature but it's still in it's early days
    -spawning mesh on the spline
    again fully optimized
    this will take only one draw call


    currently you can only put meshes here I am working on extending this to work on prefabs as well

    Update in progress...
     
  10. tchoux

    tchoux

    Joined:
    Sep 10, 2014
    Posts:
    1
    Can we have documentation plz?
     
  11. Raed_Abdullah

    Raed_Abdullah

    Joined:
    Aug 5, 2014
    Posts:
    50
    there is a documentation PDF that comes with the package :)

    UPDATE 1.1 IS AVAILABLE NOW
    :D
    and here is the release notes its not a major update but it solves some problems

    Updates will be every month I will add more features over time

    Release notes :
    1_ New : added a new save as button
    2_ New :added a new stick to ground button that will make all the points on the spline stick to the ground
    3_ New : added a new hot key (G) to stick the current point to ground
    4_ New : now when you deselect every thing you will get the default move tool to move all the spline at once
    5_ New : pivot point for the spline will always be centered
    6_ Fix : improved creating new point (fixed when you add a second path at the same point )
    7_ Fix : improved drag mode now dragging the point will be based on camera angle and if you want to stick it to ground just press (G)
    8_ Fix : added account information and extra tools description in the doc
    9_ Fix : stability improvements all over the code

    That's it !

    Please if you have any problems contact me or just post it here

    my spawning mesh feature isn't ready yet
    this may arrive at the next update :D

    I will also try to make better event calling when you reach a specific point and add the ability to put some arguments
     
    Last edited: Sep 11, 2014
  12. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,293
    Waiting for two updates now ;)
    Will there be new features?

    Edit:
    I just used your tool and have a little problem.
    I layed out the spline rely carefully but the object that should follow it precisely does have an offset some times on the path.

    I use only the move object script with the follow spline script.

    Just when it starts it has the most ofset even so the pivot is placed right.
    In the follow spline script on the advanced settings i saw an offset value of 0.4 but if i change this higher or lower it become more jittery.
    Can you help please?

    Edit2:
    So i figgured out that if i let follow the object to fast on the spline it jitter more.
    When the object follow slowlier i can set the offset value but also it jitter some times when it is slow but i do not have the great offset.

    But i always get this error, can you explain what i have to do so it goes away?

    NullReferenceException: Object reference not set to an instance of an object
    FollowSpline.Start () (at Assets/Spline tool/Scripts/FollowSpline.cs:102)
     
    Last edited: Nov 12, 2014
  13. Raed_Abdullah

    Raed_Abdullah

    Joined:
    Aug 5, 2014
    Posts:
    50
    Hey RandAlThor

    thanks for the feedback
    Unfortunately now I'm busy with a big local event, sure there will be new features in the future
    by the way the next update will be available next month

    for the offset issue you have, there is one important limitation I have in the tool which is having the same "Resolution" or segments along the spline.
    The way it's working now is that between each point and another point there is a constant number of segments
    which is currently set to 10
    I will upload a hotfix that you can change that value easily
    and increasing/decreasing the value should affect the offset

    in the next update I will work around this limitation.

    sorry if that confused you this is my first tool on asset store

    for that error can you please give me more information about it I can't replicate it on my machine
    and yea I should work more on giving better informative error messages

    hope that helped you
    and if you have ideas / bugs pleeease let me know :D
     
  14. Raed_Abdullah

    Raed_Abdullah

    Joined:
    Aug 5, 2014
    Posts:
    50
    version 1.15 is currently waiting for asset store team to submit it

    new :
    you can change the resolution of your spline (this will affect many things like precision / max speed / overall quality)
     
  15. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,293
    Can you tell me on how to change the speed per spline point that my object follow the spline.
    If this can not work now i would like to have this as a new feature maybe with smooth transition options from one spline point to the other. Also a pouse feature would be nice that can send and get massages to run again or stop.

    Thank you for the new version.

    My problem in the beginning of my object following the spline i think is from having the wrong pivot point so it has to rotate first and so stear slowly to the spline until it is there. Then everything is ok. I will test this with a new exported object with the right pivot (x,y,z axis).
     
    Last edited: Nov 14, 2014
  16. Raed_Abdullah

    Raed_Abdullah

    Joined:
    Aug 5, 2014
    Posts:
    50
    Cool :D
    talking about the speed I think you can go into the point settings when you select it

    then put a method name to call on your moving object
    now you can't pass arguments to the function like speed
    but you can make a method that increase the speed every time you call it

    and ya making better event handling is on my radar :D

    about the pause I believe you can just call a function called Pause in the FollowSpline.cs
    and you will be good to go
    there are more things like Pause-Resume-Stop-ResetToDefaults-StartMoving

    I heard that unity will make their UI system in 4.6 open source
    I will use it as a learning resource to make like their cool event system (in the button element)
     
  17. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,293
    Is there a limit on how many knot points a spline can have?
     
  18. Raed_Abdullah

    Raed_Abdullah

    Joined:
    Aug 5, 2014
    Posts:
    50
    I don't know exactly what you mean by knot points

    but there shouldn't be any limit
    the update I uploaded is now live you can download it
     
  19. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,293
    Great, i will update and play with it today.
     
  20. Raed_Abdullah

    Raed_Abdullah

    Joined:
    Aug 5, 2014
    Posts:
    50
    Hey guys we finally got unity 4.6 full release
    the tool will be using the new event system
    so I highly recommend updating

    and I'll try to make another version that works with 4.5 if you want
     
  21. Raed_Abdullah

    Raed_Abdullah

    Joined:
    Aug 5, 2014
    Posts:
    50
    Hey everyone sorry to keep you waiting
    lets get to the update


    Version 1.2 preview
    this version has very promising features and fixes
    and it will be available this month

    NEW : multiobject editing
    - select and move multiple points at once
    - delete bunch of points at once
    - you can now select 2 points and press (draw line) to make a line between them or (subdivide)
    NEW : subdivide option so now you can add a point between 2 points
    NEW : arrows on the spline to show you where the object will be moving

    note that if you want the object to move backward on the spline you can just check reverse check box in the advanced settings in the follow spline script

    NEW : unity 4.6 and above only feature : better events when the moving object reaches a point in the spline (Unity events)


    NEW : fixed resolution : the spline no longer will have difference in res between points
    NEW : merge option
    FIXED : undo not working when moving point
    FIXED : object moving wrong at the end of the spline
    NEW : real time generated spline, there is some API changes and now it's much easier to make spline real time generated while you play

    and overall stability improvement


    there are features that I'm working on but they are not ready yet like generating mesh on the spline
    it takes time
    but it'll come eventually

    have a good day, thank you :D
     
  22. Raed_Abdullah

    Raed_Abdullah

    Joined:
    Aug 5, 2014
    Posts:
    50
    Hey !
    I just uploaded version 1.2 of the tool
    waiting for unity to accept it
    and then I will post the release notes

    it has a lot of new things and improvements ;)
     
  23. Raed_Abdullah

    Raed_Abdullah

    Joined:
    Aug 5, 2014
    Posts:
    50
    Spline Tool v 1.2 is alive now
    btw I changed the name to Spline Tool for simplicity

    let't go to the full change log
    this update only meant to work for unity 4.6 and above

    NEW : Better function calling with parameters
    now you can call any public function when you reach a certain point on the spline and even pass some values in there

    NEW : Arrows simply showing you where the object that is moving along the spline will be going

    NEW : all the tools are now have their own room instead of having them drawn on top of the scene
    you can open the tools window by going to windows -> Spline tools

    NEW : super helpful multiobject editing
    -you can select multiple points
    -move them around
    -and do some operations with them like deleting and merging and drawing a line and you can even delete a line

    NEW : Remove line tool and this is a cool thing cause you can do something like this XD

    just by removing the line between them you will able to separate splines like having subsplines

    NEW : Subdivide tool it was one of the limitation of the tool that it does not have a subdivide tool but now it has *YAAAAY* to use it just click on any point then shift + click on another point and click on the subdivide button on the spline tools window

    NEW : merge tool you can select any 2 points and merge those into 1 point

    NEW : fixed resolution and this is an important one now all the resolution/segments will be the same along the whole spline you can change that by changing the resolution on the spline component 2 is a recommended magic number ;)

    NEW : Clean button this button would get rid of all the points that are not selected to any thing and will delete any extra stuff in the spline

    NEW : API changes functions like adding point and merge..... are moved to Spline script instead of the Editor script so you can edit those in real time
    I will probably make a demo and a video tutorial talking about that

    NEW : Spline icons now finally you can see your spline assets in the project window with a cool icon instead of unity default icon
    ****you must move the Gizmos folder to be under the main assets folder to see the icon changes

    NEW : You can create spline objects in the scene without creating a spline asset
    by going to gameobject -> CreateOther -> Spline Window

    NEW : you can drag & drop the spline from the project window to put in your scene (only works when you are selecting the asset) like you must select it then drag it

    NEW : center pivot point button

    NEW : Start moving function in FollowSpline script you can call and specify what is the point you want to start moving from

    NEW : updated documentation

    FIX : Undo moving a point
    FIX : object moving wrong at the last point
    FIX : spline points on scene view will receive clicks much better now
    FIX : FollowSpline will no longer create an object to follow
    FIX : when you change options like hiding stuff your changes will be saved if you close the editor you will still get the same settings.


    and of course stability improvements
    and I got new imgs on the asset store :D

    that's all for this update I hope you enjoy it
    thanks a lot and be sure to check out for another awesome update ;)
     
  24. Marscaleb

    Marscaleb

    Joined:
    Jan 7, 2014
    Posts:
    1,037
    Okay, I just bought this and I'm still learning.

    Is there any way to automatically straighten a line?
    I'll be honest with you, a good half or more of the paths I'm making are going to be straight lines, and it would be really nice if I could just arrange my nodes where I need them and then click a button to make that line straight. I imagine it would be useful in a lot of other situations as well.

    I'm also finding myself wishing I could just import an svg file. I could arrange all my paths much easier and more precisely inside another program like inkscape, and then just save them as an svg. Then I could import it in here, move and scale if needed, and its ready. I mean, this is functional, so it's not exactly critical or anything. But it would be a nice feature to have and would save me some time.
     
  25. Raed_Abdullah

    Raed_Abdullah

    Joined:
    Aug 5, 2014
    Posts:
    50
    Oh, thank you a lot Marscaleb for providing your feedback

    and well to be completely honest with you
    I didn't even think about these things before!

    I think you can create a straight line now by removing the middle points


    so press X key to delete the selected point it will give you something like this



    note to keep in mind when you delete a point :
    any point left without connection will be deleted as well
    if the point you are deleting has more than 2 connections, you need to manually reconnect your points

    if you want some points in your straight line for something like event calling
    you can use subdivide button
    but I also like your idea for doing this with a single button
    I will look into this and probably make it in the next update which will be released at February

    about the svg thing,
    It sounds like a very cool idea!
    and I'm trying to implement some kind of mesh deformation mixing these 2 features together will be super fancy

    I don't promise making it but before I do my researches ;)
     
  26. ptrcklf

    ptrcklf

    Joined:
    Dec 18, 2014
    Posts:
    2
    Pretty sweet stuff! I've been looking for a tool that lets me find the position on a spline closest to a given game object or world position. Is there a way to do this with your tool?
     
  27. Raed_Abdullah

    Raed_Abdullah

    Joined:
    Aug 5, 2014
    Posts:
    50
    mmm currently there is no way of doing this
    I wonder how you can use this information.

    and I think it's not that hard to implement such a thing I will try to make it ;)
    thank you :D
     
  28. ptrcklf

    ptrcklf

    Joined:
    Dec 18, 2014
    Posts:
    2
    It's nothing I couldn't do using the follow spline script but being able to sample the spline from a given position would make it a lot simpler to set up some custom tasks.

    Keep up the great work!
     
    Raed_Abdullah likes this.
  29. Raed_Abdullah

    Raed_Abdullah

    Joined:
    Aug 5, 2014
    Posts:
    50
    ptrcklf
    thanks :)

    If you have any problems let me know ;)
     
  30. Marscaleb

    Marscaleb

    Joined:
    Jan 7, 2014
    Posts:
    1,037
    That gives a close approximation, but the line in that image is not exactly straight; it still bends a bit to the side. If you are adding this feature, please make sure it makes that line segment exactly straight.
     
  31. Marscaleb

    Marscaleb

    Joined:
    Jan 7, 2014
    Posts:
    1,037
    Okay, I've been working with the coding part of this now, and there are a couple problems I've run into.

    First of all, I need the functionality to have an object follow multiple splines. I set up an example to try to change the spline an object is following using this:
    Code (CSharp):
    1. public SplineWindow TestExe;
    2.  
    3.     private FollowSpline MyFollowScript;
    4.    
    5.     private GameInput gInput;
    6.  
    7.     // Use this for initialization
    8.     void Start () {
    9.  
    10.         MyFollowScript = gameObject.GetComponent<FollowSpline>();
    11.    
    12.     }
    13.    
    14.     void TestPathChange () {
    15.             MyFollowScript.splineWindow = TestExe;
    16.             MyFollowScript.StartMoving(0,0,0);
    17.         }
    It successfully started the object moving when I told it to, but it did NOT change the path. I am not sure what I am doing wrong; how would I change what spline the FollowSpline script follows?

    The second thing I've run into is notifying my object when it reaches the end of the path. Is there any function that gets called? Some bool that gets flipped? I see nothing in the examples that reacts to an object reaching the end of a path. (I could call an event for a specific node, but that doesn't work right if I have a path that gets followed in reverse.) I suspect that I may need to add my own code into one of the existing scripts so I can directly call my own function in my script, but even so I don't know where I should add it to.
     
  32. Raed_Abdullah

    Raed_Abdullah

    Joined:
    Aug 5, 2014
    Posts:
    50
    Okay, I noticed this couple of days ago after I uploaded the v1.2
    so I managed to have a SetSpline function in the follow spline script that handles that for you
    but since the hotfix needs some time to go on the store I will send it to you in a PM

    and the fix also contains a callback when you finish the spline
    just name your void OnFinish()
    and it will be called when you reach the end of the path :D

    Thank you for helping me improve this tool ;)
    don't forget to rate it
     
  33. onidavin

    onidavin

    Joined:
    Jan 17, 2014
    Posts:
    5
    Two quick questions!

    1) Is there any way to draw spline points to use with the new unity GUI? Presumably I need a surface to draw on for the editor to work, but I am uncertain how to do that for the GUI. I've been able to approximate it by using WorldSpace GUI and using a Quad as the target, but figured there might be a better way.

    2) Is there a simple way to render the splines we create using a LineRenderer?
     
    Last edited: Dec 21, 2014
  34. Raed_Abdullah

    Raed_Abdullah

    Joined:
    Aug 5, 2014
    Posts:
    50
    Using it with the UI, very nice :rolleyes:
    this tool was designed for 3D use, you can totally hack it and place quad like you did
    I'm working on some 2D support since lots of people are going in that direction

    I'm very curious to see what you are working on :)

    Wow Thank you very much for pointing that for me
    I will totally do it and upload it as fast as possible

    but until then the simplest way to do that is to get the position of the point like so :
    Code (CSharp):
    1. using unityEngine;
    2.  
    3. SplineWindow someSpline;
    4. public class SomeClass : Monobehavior
    5. {
    6.        void Start()
    7.        {
    8.              // gets the world position for a point in the spline
    9.              someSpline.spline.GetPosition(index);
    10.        }
    11. }
    and in the line renderer position list you can add these positions
     
  35. onidavin

    onidavin

    Joined:
    Jan 17, 2014
    Posts:
    5
    For whatever reason, GetPosition always returns 0,0,0. I can manually access localPosition correctly using

    Code (CSharp):
    1.             splinePos = someSpline.spline.waypoints[i].position;
    But attempts to use GetPosition or just the same thing as above with position return 0,0,0. The spline points, however, are very much not at 0,0,0.
     
    Last edited: Dec 21, 2014
  36. Raed_Abdullah

    Raed_Abdullah

    Joined:
    Aug 5, 2014
    Posts:
    50
    Thank you sir, you just found a bug.
    the problem is that the spline it self initialize at Start()
    there is 2 ways to go around that

    1_ go to the SplineWindow.cs
    and change the name of the Start function to Awake

    2_ go under edit -> project settings -> script execution order
    and make your script execute at last
    or the spline window script to execute first

    hope that helped
    thank you :D
     
  37. onidavin

    onidavin

    Joined:
    Jan 17, 2014
    Posts:
    5
    It did! Thank you for the support :) It'll be trickier to render the curved ones, but I will dig into it, since now I have access to what I need.
     
  38. Raed_Abdullah

    Raed_Abdullah

    Joined:
    Aug 5, 2014
    Posts:
    50
    Cooool, I'd love to see the results

    for the curves you can check spline.GetPointAtTime(0, 0, 0);
    the first number represents a float value from 0 ~ 1 and if you entered 0.5 for example it will give you the middle point in a line

    the second number is the point index

    the last number is not that important you can leave it at 0
    but it basically represents which path you want to go if there is multiple
    so if you have a point with more than one path the first one will be at index 0 and the second at 1 .... etc

    it is a bit tricky as you mentioned

    this is a for loop example to get all Vector3 points on the spline (including curves) based on the spline resolution

    Code (CSharp):
    1.  
    2. Spline spline = someSpline;
    3. float rpp = 0.1f;
    4. for (int i = 0; i < spline.Length; i++)
    5. {
    6.    for (int s = 0; s < spline.GetSubwaysLength(i); s++)
    7.    {
    8.        // resolution per point
    9.        rpp = spline.waypoints[i].segments[s];
    10.        for (float t = rpp; t <= 1; t += rpp)
    11.        {
    12.            Vector3 point = spline.GetPointAtTime(t, i, s);
    13.            // your fancy code
    14.        }
    15.     }
    16. }
     
    Last edited: Dec 23, 2014
  39. onidavin

    onidavin

    Joined:
    Jan 17, 2014
    Posts:
    5
    Ah, thank you, that worked great! Once I am closer I will show you what I'm making with it -- basically re-building some mechanics like Osu! has for a game my wife is building :)

    I found an interesting bug, by the way! If you set a SplineFollow to have an Offset of None but it previously had an offset configured, that offset will still apply.
     
  40. Raed_Abdullah

    Raed_Abdullah

    Joined:
    Aug 5, 2014
    Posts:
    50
    Awesome ! :D

    thanks a lot for telling me about the bug :)
     
  41. Marscaleb

    Marscaleb

    Joined:
    Jan 7, 2014
    Posts:
    1,037
    How do I have an object follow a path backwards?

    I know there is the "reverse direction" command and it works great while the object is following a path. But I'm trying to start an object going backwards on a path.

    So the object stats off not following a path, and I called "ReverseMovement()" and then called "StartMoving(*,0,1)" where * was the last node on the spline. (3 in this case.) But all that happened was the object moved a tiny amount directly toward the very first node on the spline (but not following the spline) and then suddenly stopping, giving this error:
    And then it called the OnFinish function.

    I tried using "StartMoving(*,0,0)" and it was the same. I tried using "StartMoving(0,0,0)" and then the object doesn't move at all, and I constantly get this error repeating forever:
    So how do I properly tell an object to follow a spline backwards?
     
  42. Jobahed

    Jobahed

    Joined:
    Feb 24, 2014
    Posts:
    19
    I just bought this, and Unity (4.6 basic) is throwing exceptions. The icons are not showing on the Scene page either.

    Here are the exceptions:


    InvalidCastException: Cannot cast from source type to destination type.
    UnityEditor.RectSelection.UpdateSelection (UnityEngine.Object[] existingSelection, UnityEngine.Object[] newObjects, SelectionType type, Boolean isRectSelection) (at C:/BuildAgent/work/d63dfc6385190b60/Editor/Mono/SceneView/RectSelection.cs:208)
    UnityEditor.RectSelection.UpdateSelection (UnityEngine.Object[] existingSelection, UnityEngine.Object newObject, SelectionType type, Boolean isRectSelection) (at C:/BuildAgent/work/d63dfc6385190b60/Editor/Mono/SceneView/RectSelection.cs:180)
    UnityEditor.RectSelection.OnGUI () (at C:/BuildAgent/work/d63dfc6385190b60/Editor/Mono/SceneView/RectSelection.cs:139)
    UnityEditor.SceneView.HandleSelectionAndOnSceneGUI () (at C:/BuildAgent/work/d63dfc6385190b60/Editor/Mono/SceneView/SceneView.cs:1078)
    UnityEditor.SceneView.OnGUI () (at C:/BuildAgent/work/d63dfc6385190b60/Editor/Mono/SceneView/SceneView.cs:989)
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
     
  43. Raed_Abdullah

    Raed_Abdullah

    Joined:
    Aug 5, 2014
    Posts:
    50

    this option will give you what you need

    I think when Calling StartMoving(last node, 0, 0)
    that should work perfectly


    ReverseMovement() just toggles reverse flag I showed On/Off
    so if you already have it on you don't have to call it

    I recommend you to use Pause() / Resume() functions
    like setting it move on awake then at start function call Pause()
    then when you need you can call Resume()
    that should make everything much simpler

    sorry for the confusion I hope that will work
    good luck :)
     
  44. Raed_Abdullah

    Raed_Abdullah

    Joined:
    Aug 5, 2014
    Posts:
    50
    that was weird
    all I see are errors from the SceneView and that thing is coming from unity them selves

    can you provide more info
    like when this error popup ?
    4.5 basic edition was tested
    4.6 not really but it should work nothing is used out side basic
     
  45. Jobahed

    Jobahed

    Joined:
    Feb 24, 2014
    Posts:
    19
    It pops up on load. I have no on-screen icons. I can edit the spline, but the process is somewhat tedious as there is no way to hide the handles.

    Can you download 4.6 and test it?
     
  46. Raed_Abdullah

    Raed_Abdullah

    Joined:
    Aug 5, 2014
    Posts:
    50
    you should wait until Thursday I'm afraid
    I will try to replicate the error :D
     
  47. Raed_Abdullah

    Raed_Abdullah

    Joined:
    Aug 5, 2014
    Posts:
    50
    I just tested it and it's working completely !!
    please make sure that there is no other errors
    try to remove the tool and see if there is any errors
     
  48. Marscaleb

    Marscaleb

    Joined:
    Jan 7, 2014
    Posts:
    1,037
    But that is what I am doing, and it is not working.

    Perhaps what I failed to mention is that this is after changing what path I am following, because the object might be going down any of a number of paths that I've put together in a network, a web of paths. So when it needs to move, I tell it what path to follow. But some of the paths are "pointing" the opposite direction, so I have some variables set up to tell it to follow that path in the other direction.

    Code (CSharp):
    1. //Travel to North destination
    2.                         Debug.Log("Command received.  Comence movement North.");
    3.                         MyFollowScript.SetSpline(currentNode.NorthPath);
    4.  
    5.                         if (currentNode.bReverseNorthPath) {
    6.                             MyFollowScript.ReverseMovement();
    7.                             MyFollowScript.StartMoving(currentNode.NorthPathStartNode,0,1);
    8.                         }
    9.                         else
    10.                             MyFollowScript.StartMoving(0,0,0);
    11.                        
    12.                         currentNode = currentNode.NorthPathDestination.GetComponent<MapNode>();
    13.                         bIsMoving = true;
    Sure, if I reverse the path while it is follow it, it works. But this is giving the error:
    After a brief moment of travel.
     
  49. Raed_Abdullah

    Raed_Abdullah

    Joined:
    Aug 5, 2014
    Posts:
    50
    I'm investigating reverse movement
    and I hope I can make it better and easier
     
  50. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    700
    Hi,
    I'm looking for a spline based program, but what I'd like to do is generate transforms (cubes) at random locations then would like to join them together from the first to the last to use as a flightpath, but would want the transition from one to another a smooth arc, not a sudden turn, would this be possible with your Spline Tools through script?
    Thanks.