current game time||doc135768

September 20, 2022

Format

 Game.GetGameTime()
  • The class to which the function belongs:Game

Description

Get the game duration of the current game, in frames. If infinite game time is set in the editor, the game time will return to 0 .


Value Returned

type Description
int Game duration, in frames


Code Samples

local interval = 20
if Game.GetGameTime() % interval ~= 0 then
    print("todo")
end