Is it possible to get a callback after a certain frame runs?

Suppose I have an Action that is made up of an Animation. The animation was made up of 10 frames.
Now I know that it is possible to get a callback when the action is done using Sequences. However I wanted to know if it is possible to get a callback when the 5th frame is running ? or is there a way for me to know which frame is currently running in an action ?

Hi @zedan185

I guess there’s no API for this.
But, what you can do is you can subclass the Action class and modify the step function (update function) to get the current time

step function works like this -

0 means action not started
1 means the action is completed

so, if you are giving a time of 5 seconds, that will be divided within this interval to perform
Say, 10 frames 5 seconds, thus in every 0.5 sec one frame runs

Therefore, the action duration within 0-1 will now be at 0.1
so, if between 0.0 - 0.1, you are in frame 1.

something like that.

Hope that helps :smile:

Happy Coding.