I’m not sure if this is the right place to post this, but I couldn’t find an animation support category so here goes.
I’ve made a few placeholder animations for a fighting system.
All of the animation use constant style keyframes because I like how it looks. When playing the animation, the first frame gets skipped and the last frame is kept on extra to make up for the time lost by skipping the first one.
The animation priority is Action4 and all other animations are stopped from playing before starting this one.
I’ve tried changing the style to linear which worked, but I want to keep the animations as constant.
I’ve also looked around the forums, but haven’t found anyone with the same issue.
Media
Animation in editor:
Animation in playtest:
Code
-- Runs while defining other variables
local TestAnimation = Animator:LoadAnimation(ClassModel:FindFirstChild("test"))
-- Runs later in a function called by UserInputService.InputBegan
TestAnimation:Play(0)
Supposed to be in art design support but its fine. what i would do is make a slight delay before the first action/keyframe (which is the one that got skipped) and move all of the other keyframe back so its constant. alternatively, you can make an extra frame that mirrors the first frame so you can make sure the first one is played post this in Art Design Support
How are you loading the animation? Is the animation playing without being fully loaded first? Perhaps load the animation, have a delay, and then play the animation. This issue does persist in non-constant animations, but it mostly comes from a loading error, based on my experience.
Animator:LoadAnimation() is called at the start of the script while defining other variables.
TestAnimation:Play() is later called in a function fired by UserInputService.InputBegan.
I don’t think loading is the issue, because the animation acts the same after the first play.
I’ve also now tried playing the game on the client instead of studio playtest, and the issue persists.
The EasingDirection (which affects constant style for some reason) was “In” by default, changing it to “Out” has fixed the issue and everything works as intended.