Is running or at end
Nikaas last edited by Nikaas
Is there a way to check if the object:
- Is on move.
- Stopped at the last waypoint after forward move.
- Stopped at the first waypoint after reverse move.
Baroni last edited by
splineMove.tween != null would be sufficient in most cases. If you pause the tween during gameplay, add && splineMove.tween.IsPlaying() as an additional statement.
& 3. The "currentPoint" variable is the current active waypoint index. First waypoint: currentPoint == 0, last waypoint: currentPoint == waypoints.Length - 1.
In case of "ping pong" movement, the "reverse" boolean indicates the current direction. However, this is reset immediately after reaching the final waypoint.
If you wish to not only check for these states at a given time, but also receive events at the time they happen, please look into waypoint events.