Animation Track method that returns Keyframe Marker time

As a Roblox developer, it is currently too hard to control time sensitive functions using Animation Events. I am trying to get the time an Animation Event occurs relative to the start of the Animation Track so that when the Animation skips pass an Animation Event (through change of the TimePosition property), I can run the functions that should have ran normally. This is important when the skipped functions are vital to the functionality of future Animation Events. In addition, if I needed a Part to fade out starting and ending at Animation Events, determining the increment per frame to change a part’s transparency for a smooth appearance is not possiblie using Animation Events as I can not determine the time the fade end event will happen.

I did notice that there is a method for Keyframes (GetTimeOfKeyframe()) but given that Animation Events are a proper feature (They are editable in the Roblox animation editor), I do not want to resort to using Keyframes.

If this issue is addressed, it would improve my development experience because I can give more control of game functions to the animations. This allows game changes to be done solely from the Animation, which is both easy to access and will guarantee perfect timing of functions to the animations.

Thank you for your time, I really appreciate that the Roblox Staff are taking in feature requests. I hope that Animation Events can additionally get more features to tie more luau code into the animations.

Original Forum Post: https://devforum.roblox.com/t/feature-request-animation-track-method-to-get-time-of-keyframe-marker/2451482?u=gamerpro1230967

9 Likes

I full on vouch this idea, i’ve ran into this issue myself and have found a solution to it but it’s unfortunately not a good one in terms of speed or performance on startup so i HIGHLY discourage the use of it.

Resorting to solely KeyframeReached isn’t as viable as they’re more tedious to edit. it would require a constant change in keyframe names if something were to be slightly wrong with it whereas with markers you can simply drag and move them.

currently it’s possible to use the KeyframeSequenceProvider Service in order to find markers under animations. However fetching this data through there is incredibly slow and can rack up the time it takes for the server to load from what should be relatively quick to seconds or even minutes as fetching a singular animation through this takes up to 0.5 seconds (assuming longer animations = longer time) with an average of ~0.15 seconds per animation for me so far.

afbeelding

The possibility to do this is present, its just not favorable even for a server startup as some games may have increasing amount of animations.

Though something to note is that I dont think this service is intended to be ran in such a way on a game even even though it allows it to be ran on said permission level.

Sources: