Needing help with making a custom animation script

I want to play animations on characters, but by using my own operation to do so. In other words, I want to script my own animation playing method, with all the usual methods and properties, such as AdjustSpeed().

I need an in-depth explanation for some of the more seemingly complicated methods, such as the weights in animations, pausing an animation to then resume it, two animations of different weights are playing, etc.

I looked at the Developer Hub, and looked at Animation weight, but it seems to only have effect when using the default animate script. I have tried changing weights of individual poses, and setting a pose’s weight to 0 completely disabled it. If a limb branched off from the torso of a character and you edit the animation to move the limb, the torso appears as a pose, but has a weight of 0 and doesn’t move or rotate. I assume animation weight is for blending, but I need confirmation and better understanding for how that should work in the context of manually handling it.

I am not asking for an entire script that does everything for me. I simply need to know what operations I need to use in my script in order to play animations just like if you played the animation by :LoadAnimation():Play(), as well as control the custom animations like how you would with normal animations. I would also like to have my animation script handle both client and server animating without having issues like animations not replicating to the server, so if anyone knows a way to do that, please tell me.

TL;DR: I need the in-depth operations for animation functionality (animation speed and weight especially) and how to make the animations supported for client use.

I apologize if this topic isn’t fitting for the category. It seems like nobody has directly asked for a list of operations that are required in order to copy the built-in animation system, and I really need to make my own animation script so I can use my own animations in Script Executor games with ease.

3 Likes

so what do you need help with


Basically, I need the details on how certain operations in animations work if you had to do it manually, like if you had to manually lerp a CFrame from one point to another to animate a limb. I need it to either be explained in descriptive text or through a snippet of code as an example of how it would work.

so you want to use cframe animations?

Basically, yeah. I want to include other features like the ability to pause an animation midway through, and the ability to blend animations if necessary (like converting a walk animation to a run animation depending on velocity).

first of all, you need to convert your animation to a modulescript filled with cframe using Animation Converter - Roblox
second, you need to loop every cframe and use tweenservice to animate a rig.

1 Like

I might use that plugin, but I already plan on converting KeyframeSequences to data using my own method. I also noticed that TweenService has a method that allows me to calculate an alpha value based on easing style and direction, which I only now found about.

I plan on getting the times of when each pose is reached, sort them, use time() - animationPlayedAt as the current time position, and then lerp the CFrame from the last pose reached to the next.

One of the hiccups come from blending animations. Do you know of a snippet of code that would allow me to blend animations like how normal animations do? (Basic function requiring two lerped CFrames and two weight values for blending)

what do you mean “blend”
sorry for late response i had stomach issues

I don’t have much experience in blending, but from what I know, it’s when two animations of alternate weights play at once, the animation that has more weight has it’s poses more visible than the animation with less weight.

I’m probably wrong, though, since I never actually dealt with animation blending before.

you meant animation priorities. sorry for late response i slept