Hey, how ya goin. I am getting back into Roblox development slowly and I’m having a bit of issues animating. I always dread this part of game design, and I’m going to need some tips and explanation as to how certain things work, and why some of my attempts have failed. For example, watch the video below and see what I mean. I have only 2 keyframes, and I have no idea why the rig does a big little dance to turn around. Additionally, I realize to make this animation smooth, there needs to be much more than two keyframes but I don’t even know where to start.
(Note that if this video doesn’t show up, I’ll edit the post with a fixed video).
Above is an image of my keyframes so far for this animation. I am stumped, clearly.
Goal with this post:
Make a smooth animation to transition from a riding position to a forward facing position on a longboard. (That is obviously realistic and practical, of course.)
Additionally, I’d like to point out that for some reason the movements of the animation on the rig are different from the animation on the player. How can I fix this?
I’ve figured out the animations (they’ll be good enough for now.)
Only issue I’ve got now is this:
This is the current code. All the animations should be played butter smooth on a loop forever, but it reverts to the default position for a second or so.
local animtrack1 = script.Parent.Parent.Animator:LoadAnimation(script.Parent)
local animtrack2 = script.Parent.Parent.Animator:LoadAnimation(script.Parent.Parent.Animation2)
local animtrack3 = script.Parent.Parent.Animator:LoadAnimation(script.Parent.Parent.Animation3)
animtrack1:Play()
animtrack1:AdjustSpeed(0.35)
animtrack1.Ended:Connect(function()
animtrack2:Play()
animtrack2:AdjustSpeed(0.9)
end)
animtrack2.Ended:Connect(function()
animtrack3:Play()
animtrack3:AdjustSpeed(0.35)
end)
animtrack3.Ended:Connect(function()
animtrack1:Play()
animtrack1:AdjustSpeed(0.35)
end)
For some stupid reason animTrack.Ended fires slightly after it really ends, so for a split second, no animation is playing, which is why it “reverts.” What I suggest doing is finding the length of the animation (lets say 3.2 seconds) then multiply by 0.35, (like you had in your script) and using task.wait(1), as opposed to task.wait(1.12). By making the wait time slightly shorter than the animation length itself, it should be very smooth.
In theory, should work. But animations still look wonky. The second animation is 0.6 seconds long (60% of the frames of a 1 second long animation). I suck at math but I’m at a loss as to what is going on here.