Help with flipbook animation in widget

Hi, I have problem with framerate of animation. So I wanted to make animation in widget using paper 2d flipbook and now i need to make flipbook change frames in 24fps. I tried doing something with delta time but I dont know what to do anymore. I need to do something so widget would change its image every 1/24 second. sorry for bad english and here i give you all screens you guys might need <3



1 Like

Hello! The simplest way would be to change the tick interval of your widget and set it to 1/24 seconds

The only drawback is if your game’s framerate drops bellow 24 fps then the flipbook animation will be slower.

I didnt explain my problem well. So what i need to do, is change ammount of “FrameCounter” every 1/24 second and add 1, but i dont really know how to make it increast one every 1/24 second. I hope i explained it better now, yesterday i was bit retarded also sorry for bad english

No worries you explained it well in your first post.
The tick event is usually executed every frame, but if you change the setting I mentioned in my previous post it will be executed every 1/24 seconds, which is the rate you want for your flipbook.
Then you just have to increment your counter on the tick, this way FrameCounter will be incremented by one every 1/24 seconds

How do I do this in widget?

Ah right, this option is not available in widgets.
Alternatively you can simply accumulate the frame time until it reaches 1/24 seconds and increment your counter then

Also another option would be tu use a timer instead of relying on the tick:

Timer

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.