Hi there, I’m trying to use Mathf.Pingpong to limit the min and max of a number (currentTargetIndex) and pingpong it between 0 and a MAX value (3):
currentTargetIndex++;
currentTargetIndex = (int)Mathf.PingPong (currentTargetIndex, 3);
So I’m after this: 0, 1, 2, 3, 2, 1, 0, 1, 2 etc etc
I’m getting the impression that this function isn’t designed to achieve what I’m after - or perhaps I"m just not using it correctly. Can anyone advise me? Any help, much appreciated!