Create custom play animation function (SOLVED)

Hello all.

I create custom play animation function for flexible animation control(speed, delay between frames and other).
My project configurated for use 30FPS refresh

For count frame I place in on_update simple counter

self.fps=self.fps + 1 + dt
if self.fps >= 30 then
self.fps = 0 -- zero self.fps for count next 30 frame
-- something happened
end

I right understand what every 30 frame passes 1 second real time or not?

Delta time will usually be 1/update_frequency. In your case if you’ve set update frequency to 30 then dt will be ~0.033. So to answer your question, when 30 frames have elapsed then 1 second has elapsed (0.033 * 30 = ~= 1.0).

1 Like

Thank you.