Difference between revisions of "GetSecondsPassed"
no edit summary
imported>JustTim (revert. this example is absolutely correct. timer is meant to count backwards! you have to set timer to the desired amount of seconds) |
imported>Talkie Toaster |
||
Line 2: | Line 2: | ||
GetSecondsPassed | GetSecondsPassed | ||
Returns the number of seconds passed since the last game frame (in float). Extremely useful for running a timer within a script. | Returns the number of seconds passed since the last game frame (in float). Extremely useful for running a timer within a script. Much like getbuttonpressed, it only returns a value the first time it is called within a frame, and all subsequent calls return 0. | ||
Line 17: | Line 17: | ||
end | end | ||
'''Example Two:''' | |||
float timer1 | |||
float timer2 | |||
begin gamemode | |||
set timer1 to getsecondspassed ;This returns the time passed since the last frame | |||
set timer2 to getsecondspassed ;This returns zero | |||
end | |||
[[Category: Functions]] | [[Category: Functions]] | ||
[[Category: Time Functions]] | [[Category: Time Functions]] |