Invalid operation for this animation format

Invalid operation for this animation format.

This is the error I get everytime I run this script

local anim = script.Parent.Humanoid:LoadAnimation(script.Parent.AnimateSauce.climb.ClimbAnim)

anim:Play()

local timething = anim:GetTimeOfKeyframe("Tray")

print(timething)

The animation does play, but it doesnt print the time position of the Keyframe I named “Tray”
There’s no solutions on the devforum and this is my first time encountering it

1 Like

So apparently the issue here is the GetTimeOfKeyframe() line? Does the “Tray” Keyframe exist?

It does exist here
image

It doesn’t seem to work if you enable the Curve-Editor. If you aren’t using Curve-Editor, perhaps try using KeyFrameReached?

im using moon animator 2, which doesnt have a curve editor as long as i remember

the reason i need to get the time position is work cutscenes, for example i can use 2 keyframes and do KeyframeEndPosition - KeyframeStartPosition and basically get how long does it take for the game to reach from 1 keyframe to another,

im bad at explaining but this will be very useful for me.

local Animation = script.Parent.Humanoid.Animator:LoadAnimation(script.Parent.ThingyFrame)

repeat wait() until Animation.Length > 0

Animation:Play()
local Time = Animation:GetTimeOfKeyframe("Tray")

print(Time.." is the time of the keyframe Tray")

Doing this is became the solution for me, I knew the animation didnt load

4 Likes

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