waypoint question

Blitz3D Forums/Blitz3D Beginners Area/waypoint question

stayne(Posted 2015) [#1]
Hey folks. If you have 10 waypoints and want to walk from 1 to 10 then turn around and walk from 10 to 1, over and over, how the heck would you do it? Cube walks to 10 fine from one waypoint to the next but I can't get my head around how to construct a way to reverse it. I have a c\nextwaypoint field that adds 1 every time the cube gets close enough to a waypoint, but want to subtract 1 once it hits the max until it gets back to 1.

I'm getting too old for this :(

Here's what I came up with for starters:




Floyd(Posted 2015) [#2]
You need another field for direction, call it dir.

At the first waypoint set dir = 1, at the last set dir = -1.

Move with waypoint + dir instead of the current waypoint + 1.


stayne(Posted 2015) [#3]
That works thanks Floyd!