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

45 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:


8 Likes

bump bump bump bump bump bump bump bump bump

1 Like

BUMPPPPPPPPPPPPPPPPPPP!!!

(bump)

bump bump bump bump bump bump bump bump bump

Why is this not a thing yet… I have to resort to changing keyframe names of an animation just for this functionality. It’s like I can’t use just keyframe names for scheduling events to happen during an animation and I can’t just use markers because they both have annoying inconveniences.


We have: AnimationTrack:GetTimeOfKeyframe(keyframeName)

We need: AnimationTrack:GetTimeOfMarker(markerName)


So simple.

Pease make animation markers better by adding this functionality.


Edit: I’ve added this functionality to my “Animations” module through Animations:GetTimeOfMarker() in case anyone is interested: Animations | All-in-1 animation player and pre-loader for client and server

14 Likes

bumping, the animationtrack as a whole needs more love. we need this and additives especially but it would be real nice to get a dedicated upgrade for animationtracks.

1 Like

Thank you for the explanation.

I’ve added this functionality to my “Animations” module through Animations:GetTimeOfMarker() in case anyone is interested: Animations | All-in-1 animation player and pre-loader for client and server

1 Like

I am also in need of this feature!

1 Like

Bumping, it just seems insane that this was left behind while the GetTimeOfKeyframe still exists… annoys me to think @VoidedBlades’s solution is probably the only choice for now and we’ll just have to ignore the startup lag

2 Likes

Bump, how do we not have this yet??? Please roblox I need this

2 Likes

I’m working on GEngine , a Custom Animation Engine that already has this feature.
AnimationClass:GetTimeOfMarker(markerName)

It’s definitely not limited to the following features :

  • Animation Additivity
  • Data Cleanup
  • Non-strict Playback-FPS
  • SetControl(..., toggle) for total animation control
  • Trees

Sounds good. Let us know when you got that done and it would be cool for us to check out.

1 Like

Of course, I will make a thread concerning it when I’m done rewriting it, optimizing it, adding more features to it.
What’s cooking right now in the kitchen is an FFI, a studio plug-in, and a better in-game debug UI

Please excuse my rant,

I’d really like for this to be a feature. If you need to pause an animation when :GetMarkerReachedSignal() fires it pauses the animation a frame too late, you have to go back and set the .TimePosition of the track to where the marker is. This isn’t normally bothersome unless you need a limb animated in a precise position to modify motor6d cframes with 100% accuracy.

That’s all easily done- if you know what time the marker is at…

Except you don’t- unless you’re willing to open the animation and check what time position the marker is at then update the .TimePosition() in your code wherever that marker is used, and do this every single time you move the marker…

It would be much easier for this to be automatic- no need to go in and change your code every time you move your markers.

I can see how this wasn’t an anticipated need- its a very niche case scenario to need the time position of a marker, especially if making your animation is more of a one-and-done thing, but if you’re like me and constantly tweak your animations this feature is a must have.

1 Like

So you are basically talking about how defered events broke entire roblox?
Its true btw they indeed broke entire engine.

Yeah basically. Can’t use deferred events and use marker events to pause tracks precisely at the same time- one or the other I suppose.

I mean I think to combat that animation markers should just have built in ways to modify the animation track’s speed without scripting- that would be nice.

Honestly what is really stopping you from putting value of keyframe marker to a stringified number coresponding to time position?
Hacky but works pretty well.

1 Like

Thats a good idea actually, feels so unnecessary but it saves me from opening up scripts.

3 Likes

I’m still working on this lads
A lot of progress

and now, I can see how useful Animation:GetTimeOfMarker(markerName) can be..