Skip to main content

Mathf.PingPong(number t, number length)

PingPong returns a value that will increment and decrement between the value 0 and length.

Parameters:

NameTypeDescription
tnumbera self-incrementing value
lengthnumberlength

Returns:

typeDescription
numbera value that will increment and decrement between the value 0 and length.

Usage

---@type number
local t;

---@type number
local length;


local val0 = Mathf:PingPong(t, length)

Extra Detail

PingPong requires the value t to be a self-incrementing value, for example Time.time, and Time.unscaledTime.