Modifying and Extending



  • Hello

    When I purchased SWS I thought it was possible because I actually contacted the developer of Dotween and explained my goal, instead of Dotween he strongly recommended SWS as I need to constantly modify the path but now I see it is not possible... Hmm

    The path isn't constantly changing but when user taps, the player goes straight instead of going left or right according to the path. The player endlessly moves forward non-stop and this is isometric tilemap / top-down-ish.

    Because the path can change when user taps & at the same time the player needs to keep moving on the path, I thought the path will need to be constantly extended perhaps 5 tiles ahead as the player moves forward.

    Is stopping the current tween as soon as user taps and start a new tween from right there immediately so it won't look laggy and have smooooth transition?
    As for the extension, constantly "extending" the path with newly added waypoints seems to be impossible but perhaps also start a new path as soon as the player reaches the end point..? Note that the player's randomly speeds up and down capriciously.... Ok at least I tried lol

    Thanks in advance!



  • Hi,

    what is not possible is to modify the path at runtime, continuously. However, doing changes at runtime is definitely possible with some limitations.

    I'm not quite sure how you are expecting the "tap" mechanic in your game to work, so I try to keep this general.

    • you could have several paths relative to the player. If you want to go left/right, you would enable "moveToPath" and swap out the target path using splineMove.SetPath.
    • instead of having predefined paths, you could also create these paths at runtime. See our runtime example scene for that.
    • constantly moving forward would follow the same logic: your object could follow "path1", when you place "path2" in front of it. Switch the path to "path2", and while moving on that take "path1" and place it in front. Or when moving on a single path and reaching the last waypoint, reposition it one waypoint ahead with "moveToPath" enabled. There is not going to be a hiccup in movement.

    This is basically what you've described in your last paragraph to some extent. It might take a few tries to get right, especially with random movement speed.



  • @Baroni That actually sounds very promising.. thanks!!


Log in to reply