AdjustSpeed making Animations play weird

Midst of converting my weapon system to use keyframes, I stumbled upon an issue where the AdjustSpeed function of an AnimationTrack is acting weird when called upon. It will force the animation to play only the last keyframe of the animation and stay stuck there. I’ve looked at the animation in the animation editor and there’s nothing wrong with it as well as prior to using AdjustSpeed, it played perfectly fine.

Here is a code snipet. I honestly have no clue what’s causing this issue. I’ve tried using the parameters in the Play function, but the same error happens.

Because you’re adjusting the speed after the animation track has started playing, it may be the cause of why it is not turning out the way you want it to. Try calling the AdjustSpeed method on the animation track before you play it.

Calling it before Play wouldn’t do anything because no parameters are set in Play, so the speed would just be reset to default.

You could alternatively try including the speed value as the third argument in the Play method. That way you can eliminate the need to call AdjustSpeed. I would link the devhub page with the documentation, but it is currently giving me a 502 bad gateway error. If I recall correctly the first argument is the fade time (0.1 as default), then the weight (1 as default) and the third argument is the playback speed (1 as default, which you can replace with your speed value).

1 Like