KeyFrameModule V3 Here u can download it:
AnimatorModule_KeyFrameReader.rbxm (9.3 KB)
What is KeyFrameSequence?
KeyframeSequence - an object in Roblox that is used to store and manage animations. It is a set of keyframes that define the position, rotation, and scale of an object at specific points in time.
why is it better to use key frames?
In fact, Animation is a twin between keyframes (During the writing of the module, I realized that this is not the case, because it does not move desks - but Motor6D)
To begin with, roblox studio probably uses a fairly similar code to my module and the difference is minimal, however:
1 - If you have published an animation and deleted the KeyFrame, then you will have to re-publish this animation in order to update its ID. I don’t know about others, but it’s a big problem for me.
**2 -**The co-authors will also see this animation in the studio, which is very cool, because now you don’t have to publish the game just so that your friend can see the animation
3- Open source, you can completely change the type of animation playback with the exception of the already created 3 (transform, C0, Combined)
4 - (I’m bad at animation, tell me if I’m wrong) I also think it is important to mention the possibility of “FadeTime”, thanks to which animations can be made more dynamic
5 -
The point of the module is that you don’t have a question “why don’t I use a regular animator”. The module is designed not only for ordinary users who will find it easier to make a game using it, but also for people who will add other animationmodes for their games. (You can request their addition from me). Still, OpenSourse is better than CloseSourse. In general, there are moments where my module wins
API
- Start
local AnimationClass = require( game.ReplicatedStorage.Animator ) -- Set your path
local AnimationObject = AnimationClass.new(game.Workspace:WaitForChild("Rig").Humanoid) -- Your rig (you can also use the player)
local AnimationTrack = AnimationObject:LoadAnimation(game.ReplicatedStorage.Animations.RigAnim) -- Path to KeyFrameSequence
- AnimationModes
Animator.AnimationMode = ... ::number
AnimationObject.AnimationMode = 0 --[[Is "Transform mode - Modifies the entire CFrame of the joint(position and rotation) using joint.joint.Transform"]]
AnimationObject.AnimationMode = 1 --[[Is "C0 mode" - Modifies only the rotation of the joint using joint.joint.C0]]
AnimationObject.AnimationMode = 2 --[[Is new and best "Combined mode - Uses joint.joint.Transform for joints where the CFrame has changed,and joint.joint.C0 for all others."]]
- Methods
Animation:Play(... , ... , ...) -- OPTIONAL you can specify FadeTime,Weight,Speed inside
Animation:Stop(... ::number) -- OPTIONAL you can specify FadeTime inside
Animation:AdjustSpeed(... ::number)
Animation:AdjustWeight(...::number) -- + OPTIONAL you can specify FadeTime
Animator:Destroy() --[[ TODO if your type not is a C0 mode then: ALWAYS call after Animation.Stopped:Wait() !!!]]
AnimationModule:GetPlayingAnimations() -- Idk, I didn't check if it worked. It seems to me that probably not
- Attributes
print(Animation.Name::string)
print(Animation.Speed::number)
print(Animation.Length::number)
print(Animation.IsPlaying::BoolValue)
print(Animation.Looped::BoolValue) -- Can be changed (assigned to)
- Signals
print("Wait","Connect","Once","Fire")
print(Animation.DidLoop)
print(Animation.Stopped)
print(Animation.Ended)
- Priority
Animation.Priority = Enum.AnimationPriority:GetEnumItems()