I need to make a procedural jump in a board game which is called every time when I need to do so in the script. This allows player to move between waypoints. So for example the player gets the number 6 from a game dice and the script has to make 6 jumps through waypoints.
I've tried to use
**Vector3.MoveTowards **
to move between waypoints but it doesn't work the way I imagined it would. I've also tried to use animation of jump but it's tied to a certain place so I cannot move between 2 and 3 point if animation is between 1 and 2 point.
Please say me. Can I use an animation and how can I use it? Or how can I modify my script so it's:
- take next point
- move to it
- make this point as a current
- take next point ...
For this, it is necessary to place the Transform fields in an array. Then implement a code similar to what I have written below. With the help of DoTweenPro plugin and using the Jump command, your problem will be solved.
After specifying the transforms in the scene, just add a short test like below to the above script and that's it!