Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. We are looking for your feedback about Templates! Tell us about your experiences by taking our survey.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Simple Waypoint System (SWS) - Move objects along paths

Discussion in 'Assets and Asset Store' started by Baroni, Dec 10, 2011.

  1. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,357
    Hi @andreiagmu,

    SWS makes use of the global setting (be it update type or timescale) specified in DOTween's settings indeed, so that any tween can be configured to run before or after your game's update logic.

    This is the first time an individual setting per movement script has come up, could you please explain a use case where the global setting does not cover this? Note: navMove is not controlled by tweens/DOTween and has the default Unity update loop for NavMesh agents.
     
    andreiagmu likes this.
  2. andreiagmu

    andreiagmu

    Joined:
    Feb 20, 2014
    Posts:
    46
    Oh, I hadn't used navMove yet, I didn't know it doesn't use tweens, hehe.
    So in my suggestion, splineMove is the only relevant move.

    For now, I can use the DOTween global settings alright. I just thought of the possibility of I needing/wanting some splineMoves to run on Update, others on FixedUpdate, etc. Or I wanting some splineMoves to be TimeScale Independent, and others not, that kind of thing.
     
  3. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,357
    Sure, let me know when that happens :)
    TimeScale independent tweens are usually used in UI animations, however you wouldn't use splineMove for that but a scripted tween directly (depends on the game of course).
     
    andreiagmu likes this.
  4. martinreimer

    martinreimer

    Joined:
    Feb 21, 2018
    Posts:
    15
    @Baroni Im running Unity 2019.2.17f1 and getting null ref errors

    Steps to recreate: 1. Create waypoint manager 2. Enter path name and hit start path 3. When i hit P I receive the first error.


    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. SWS.WaypointEditor.OnSceneGUI () (at Assets/SWS/Scripts/Editor/WaypointEditor.cs:62)
    3. System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <567df3e0919241ba98db88bec4c6696f>:0)
    4. Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    5. System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <567df3e0919241ba98db88bec4c6696f>:0)
    6. System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <567df3e0919241ba98db88bec4c6696f>:0)
    7. UnityEditor.SceneView.CallOnSceneGUI () (at C:/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:3292)
    8. UnityEditor.SceneView.HandleSelectionAndOnSceneGUI () (at C:/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:2539)
    9. UnityEditor.SceneView.OnGUI () (at C:/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:2400)
    10. System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <567df3e0919241ba98db88bec4c6696f>:0)
    11. Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    12. System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <567df3e0919241ba98db88bec4c6696f>:0)
    13. System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <567df3e0919241ba98db88bec4c6696f>:0)
    14. UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:359)
    15. UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:353)
    16. UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:329)
    17. UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect, System.Boolean floatingWindow, System.Boolean isBottomTab) (at C:/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:374)
    18. UnityEditor.DockArea.OldOnGUI () (at C:/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:341)
    19. UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:298)
    20. UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:483)
    21. UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:466)
    22. UnityEngine.UIElements.KeyboardEventDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/Events/KeyboardEventDispatchingStrategy.cs:21)
    23. UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:280)
    24. UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at C:/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:156)
    25. UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at C:/buildslave/unity/build/Modules/UIElements/Panel.cs:190)
    26. UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:255)
    27. UnityEngine.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at C:/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:78)
    28. UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)
    29.  
     
    Last edited: Feb 10, 2020
  5. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,357
    @martinreimer
    Looks like a Unity bug. Did you recently upgrade? Have you tried restarting Unity and resetting the editor layout (top right corner)?

    Please use the forum on our website for further support.
     
  6. martinreimer

    martinreimer

    Joined:
    Feb 21, 2018
    Posts:
    15
    Resetting the layout resolved the issue. Thanks!
     
  7. SpyrosUn

    SpyrosUn

    Joined:
    Nov 20, 2016
    Posts:
    133
    Hi ! Would i be able to use the simple waypoint system to control a character with the mouse dynamically while playing ?

    Thanks !
     
  8. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,357
    Hey @SpyrosUn, what exactly do you mean by "control a character with the mouse"? Do you mean adjusting speed, or jumping while it moves? That would be very easy.

    I mean, if you would like to add point and click movement to your game, you wouldn't necessarily need a waypoint system - Unity's NavMesh system would work for that too. Could you define your requirement a bit more? :)
     
  9. Nikaas

    Nikaas

    Joined:
    May 30, 2013
    Posts:
    97
    Line 83 in splineMoveEditor class causes Unity to lag when a prefab with splineMove component is selected in the project hierarchy. There are similar cases in navMoveEditor and moveEditor classes.
     
  10. charith-madusanka

    charith-madusanka

    Joined:
    Feb 10, 2017
    Posts:
    5
    How can i change time to complete loop at runtime???
    @Baroni
     
  11. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,357
  12. jackvob1

    jackvob1

    Joined:
    Mar 2, 2018
    Posts:
    38
    Hello, im interested with your asset to use in one of my project for my ai waypoint in the road , i want to ask a couple question :
    1. in the image it could change path but only 2 path is it availabe to change path with 3 path ?
    2. for interaction with other object (Like other cars or traffic light) is there already script in the asset or we need to create it ourself ?

    i have a lot of question but i cant think of any right now :) i think thats it for now, Thank you
     
  13. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,357
    Hi @jackvob1,

    1. A path is a path, you can switch from one to another. It is irrelevant how many paths you have in your scene.
    2. Game specific code needs to be created by yourself. There are public methods available for most scenarios, but there is no template for vehicle simulation since this depends on your game.
     
  14. tomi-trescak

    tomi-trescak

    Joined:
    Jul 31, 2013
    Posts:
    77
    Hi, I did purchase SWS 6 years ago but no longer have access to Invoice ID so I do not know how to register for your forums. But I can show you a screenshot of my asset store.

    Anyway, my issue is that I cannot make the camera following the object on a spline path work. I use the simplest camera to follow the script from Unity API. BUT the object on the path JUDDERS horribly! The environment moves smoothly, but the object jumps back and forth.

    If I just parent the camera to the moving object it works, but the camera movements are too sharp. Thus:

    How can I make the camera follow the smoothly moving object?

    [EDIT] I made small GIF showing my issue: https://ibb.co/6WqhPxL
     
    Last edited: Aug 24, 2020
  15. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,357
    Hi @tomi-trescak,

    did you see our camera sample scene? Are you able to reproduce the issue there as well?

    A quick trick would be to set the "lookAhead" value on the movement script to something very small. It goes from 0-1, so you could try 0.02. This usually smoothes it out quite a bit.

    Regarding your lost invoice, please head over to your asset store account on the orders page. If you get the order ID, you would be able to contact Unity support for the corresponding invoice ID.
     
  16. usama-qureshi

    usama-qureshi

    Joined:
    Apr 22, 2016
    Posts:
    4
    'WaypointManager' does not contain a definition for 'Paths' ,, This error comes when SWS package imported,
    walker.GetComponent<splineMove>().SetPath(WaypointManager.Paths[path.name]);
    example2.moveRef.SetPath(WaypointManager.Paths[example2.pathName1]);

    these are the lines where this error show. Unity version 2019.2.16.
     
  17. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,357
    @usama-qureshi We do not use this forum for support. Please register on our dedicated support forum, on our website.

    Quick tip: it is likely that you have another class named "WaypointManager" in your project, not in a namespace, which is interfering.
     
  18. UDN_5c806b49-d8a0-4f67-a296-c12c91aa7396

    UDN_5c806b49-d8a0-4f67-a296-c12c91aa7396

    Joined:
    Jan 9, 2017
    Posts:
    140
    Why does using navMove momentarily stops agents on each waypoint? Why doesn't it smoothly just continues to the next waypoint without delays?
     
  19. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,357
  20. UDN_5c806b49-d8a0-4f67-a296-c12c91aa7396

    UDN_5c806b49-d8a0-4f67-a296-c12c91aa7396

    Joined:
    Jan 9, 2017
    Posts:
    140
    Nope, I'm not (but really thinking of getting a copy myself, looks neat). I'm helping my bud with some stuff for his game. He probably has the invoice.

    [code removed as per author request]

    Anyway, I did this to make it smooth.
     
    Last edited: Sep 14, 2020
  21. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,357
    As per Unity Asset Store EULA, editor extensions are licensed per seat. If you are "helping your bud", you still need a license for yourself. Please remove the code snippet you've posted. This is a public forum, it is not allowed to share snippets of our code here. We've specifically set up our own support forum for things like this - and we would really like it there!
     
    aweha likes this.
unityunity