KeyframePlayer: Server-Sided KeyframeSequence player!

KeyframePlayer v1.6

Hello! I made a module, based mainly on animations and NPCs in mind. Allowing to play any animation at any given time, this module is able to be used in situations where you don’t own a place but you still would like to play your animations, such as an NPC you created or a ViewModel that you would like to be animated. Sadly anything such as a tool or layered animations like so doesn’t work at all, anything that doesn’t have animations by default will work. Feel free to show off anything you make with this module as well as if you find any bugs, feel free to also report them here.

Here’s some videos to show it off, might not be obvious but the animations are loaded KeyframeSequences.


Sample Code

local AnimsBase = require(game:GetService("ServerStorage").KeyframePlayer)
local Animation = AnimsBase:LoadAnimation(script.Parent.Humanoid, script.KeyframeSequence)
task.wait(2)
Animation:AdjustSpeed(2)
Animation:Play()
task.wait(1)
Animation:Stop()

Links

Upsides

  • Able to share animations and play them without having to be reuploaded.

  • Easily modifiable code to fix any bugs that you happen to encounter.

  • Animations are kept safe inside of the humanoid.

Downsides

  • Unable to overlap 2 KeyframeSequences at once, stops other animation.

  • Unable to play over in-game animations.

  • Not optimized.

  • Unable to reset back to normal position normally without modifying the source code.

Bugs

  • Laggy reversed and slowed animations when reversed.

  • Somewhat jittery, but sort of fixed.

To do list

  • Optimizing the “Play” function, cutting down on clones and loops.

  • Fix the noticeable tween difference upon being reversed.

  • Allow “priorities” for animations, along with overlapping/layered animations.

Done

  • Being able to set the speed of the animation. Feature was added in v1.5.
20 Likes

This is pretty neat, One issue im having though is that when playing an animation it starts to jitter, The animation’s made in moon animator and i’m just exported keyframe.

This does fix the annoyance i had of having to constantly upload new animations even if they were just testing animations. :+1:

3 Likes

Would you please describe how it’s jittering?
Edit 1: I see what you mean now, some of the tweenings are a little bit rough.
Edit 2: Sorta fixed it.

2 Likes

Because this is server-sided, won’t this make animations look laggy on the client if they have high/inconsistent ping? The built-in animation system just tells the client to load an animation and play it.

4 Likes

Yeah, but I could implement a feature where it puts scripts inside of PlayerGui or something, probably would stop this but then again, it would possibly mean the server wouldn’t see the animation at all.

2 Likes

hey! was using this and noticed it doesn’t work with curve animations, please fix!

2 Likes

i dont think curveanimations are readable like that, its kinda wonky

3 Likes

yeah i’d need to learn how they work, don’t they work with bezier curves or something like that

2 Likes

You didnt understood how animation works.
The way you wanted make it supposed to look like:
Join.Cframe * Pose:Inverse()
I made similar module wich makes it job better but have own issues KeyframeSequance to Animation

2 Likes

Ah, haven’t read this post or updated it in a long time. Thanks for the response, I will add it when I get to updating this module.

Honestly, I don’t understand why I put a “branch” thing inside of the model. Maybe I was thinking people would modify it? :sweat_smile: