Search Unity

  1. 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
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    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,310
    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:
    34
    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,310
    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:
    7
    @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,310
    @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:
    7
    Resetting the layout resolved the issue. Thanks!
     
  7. SpyrosUn

    SpyrosUn

    Joined:
    Nov 20, 2016
    Posts:
    124
    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,310
    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? :)
     
unityunity