Playing animation in screen space

I am needing to display an animation on the screen, and remove it once the animation is over. This is currently being done by adding a widget to the viewport, the widget has an image who’s texture is a spritesheet flipbook material. The problem with this is that I don’t know where the animation is at in order to stop playing it once it is over. The animation needs to have transparency, so what is the best way to go about doing this?

i see only one and stupid way, delay.
actually two, also another actor spawned with timeline, if you need to know current moment.
even three stupid ideas, instead of additional actor, you can use function with some small delay like 0.15 which would increment float variable every time when trigger post delay for a delay time.

is there are any way to get current frame from flipbook? it would be way more smart.

The first method seems very inefficient. I’m not sure if I can get the frame from the flipbook, as everything is contained within a material.

What’s controlling the playback of the animation? If you know the framerate and the number of frames, you would know the duration, so would also know when it ends - if you knew when it begun - I presume there is some variable?

Nope, there is just a material that constantly loops the animation, so I don;t know anything about the current frame, meaning that half the time I spawn the animation, it is half-way through.

^ thats bad design, i hope someone would help you, so i could use it as well =)