Simple Waypoint System (SWS) - Move objects along paths

Hi @RobertEspinoza , I’m usually bad at guessing - to save some time, could you please send a small repro project to our support email (found on our website, or last page in documentation pdf), so I can take a look at your setup directly.

Hi.
wanted to know, how are those obstacles there.
if the program does not show them in the hierarchy lable.
I can make my soldiers avoid obstacles.

in other words:
it is obvious that there is an obstacle there. (seen in the video)
but I can not find it anywhere,
my question is how can I do to create those obstacles please.
I tried and I did not succeed.
please help.

While I can’t look into your project and make a guess by watching a video, it seems that you are using the navMove movement script on these soldiers? Have a look at the NavMesh then, which may needs a rebake.

please …
how instantiate a prebab walker that include already the path please ?
.

3254426--250665--prefab not include.jpg

@fla-rar paths are bound to the scene. You cannot assign scene objects to prefabs. If you instantiate a prefab with a movement script, you can call SetPath on it to assign the path, but disable “OnStart” in the inspector first.

Thanks … ! i will try !

sorry …
just to know … if you have some basic manual to use it ?
i search on internet but the link send another place.
but basic, i need to know the different
standar and bezier please
.

@fla-rar please see the documentation pdf included in the SWS folder for a basic manual and differences on standard and bezier paths. You can also just create both of them and see the difference yourself - standard paths are basic curves, while bezier paths have several more points and allow for detailed definition of their segments. Also, Wikipedia provides great information for both type of curves.

thanks so much … …
i didnt know the pdf manual … thansk so much, i apreciate !

Hello @Baroni1 ,

just a quick one. My “move to path” speed of an object is ridiculously low compared to the speed (time value: speed) of movement between the paths. Is there any way of adjusting it? Or is it the same as speed of movement between paths and i’m doing something wrong? It’s a 2D game, everything’s set on Z: 1, including paths.

Hi @Oshigawa , “moveToPath” creates a tween with the same base settings defined on your movement script in the inspector, it’s actually the exact same method being called as for the “regular” tween. Could you describe steps for me to reproduce this is one of the example scenes?

Hope you don’t mind if i do it like this

Here’s the ship using SWS (blue square for position) and waypoint 0 is the lower purple square. Path is Bezier, i’m using Playmaker to set path.

Here’s the spline move script setting

Path setting

All the waypoint transforms are also on Z:1

Also, if it’s worth knowing, i haven’t updated to latest version.

I’m unable to provide the gif at the moment, but it takes 4,1 seconds to reach waypoint 0, and about two seconds from waypoint 0 to waypoint 1.

I can only take a guess here, since that’s not what I’m seeing in the example scenes (and also not in any previous version of SWS). Could you switch the “Time Value” dropdown from ‘Speed’ to ‘Time’, and have a look at the “Ease Type” dropdown that shows up, verifying that its value is set to ‘Linear’? - This has changed in a later version, where the ease type dropdown is always visible, since it affects both speed and time tweens.

Oh i played around with it, some ease was probably set, left that way and returned to linear. I’ll check it out and let you know!


How to fix spike ?! Thanks

This looks like a method from DOTween. Are you calling something specific in SWS at that point?

I use pooling. While game object active a random position on screen, I called again CalcalatePath() function for BezierPathManager. The last, I called SetPath() function.

If Path long, CatmullRomDecoder.SetTimeToLenghtTables(), CatmullRomDecoder.SetWaypointsLenghts() create more GC Alloc and Time ms high (>16 ms).

[mention|faPWDSqCu26g2CHuciEFJw==] CatmullRomDecoder is a class from DOTween as well. If this is troubling to you, I would suggest posting this in the official DOTween thread instead, or contacting its developer directly.

Both CalculatePath() and SetPath() methods in SWS do calculations which are used for initialization and therefore need more resources once in the beginning, but nearly zero afterwards. CalculatePath is a performance heavy operation (this is stated in the scripting reference already) because it allows for recalculating and updating the whole path at runtime. SetPath on the other hand is responsible for initializing the tween you are using for movement on the path, which needs some CPU time for that too.

SplineMove could really use first point and last point reached UnityEvents that are always available, even if a path hasn’t been assigned. Currently, I have to redo events if the assigned path or points change. And, I can’t assign a finished event in-editor when the path is set procedurally. Always visible first and last point events would solve both of those problems.