![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | adrianP |
Hi. I want to divide a number by another number and if the remainder is equal to 0, then do something.
My code is the following:
motion.x = initial_speed
var time_passed = OS.get_ticks_msec()
if time_passed % 2000 == 0:
motion.x += added_speed
print("current time is: ", time_passed)
I get the time elapsed since the beginning in ms and every 2 seconds (division by 2000) increase the speed by a certain amount. What am I doing wrong?