I am currently trying to make a stand from JoJo’s bizarre adventure, but I am stuck on the Idle Animation. The idle animation is programmed with the position data, it isn’t there otherwise without the idle animation, but whenever I play the Idle Animation it begins, but it goes from position that its supposed to be in but it then loops back and basically does a twitching movement. https://gyazo.com/1caa55631fe67e1d745a7e1a202a731b
The opening to your thread is a little jumbled but I believe this is merely a problem with the animation you’re running on the NPC rather than anything having to do with the scripts. Perhaps you’d like to improve on the animation. Are you able to show what at least three loops of the animation looks like on the animation editor?
If you’re firing AnimationTrack:Play() multiple times before the animation can finish, it can cause that twitching movement.
If that is not the case, another possibility is what @colbert2677 said. Your animation does not end on the same keyframes that the animation started on. To fix this, copy and paste the absolute beginning animation keyframes to the end of the animation. You might have to move some stuff around.
My bad for responding late, completely forgot about this, but I set the animation to a loop, so thats not what is causing it. Heres a picture of the animation with keyframes, but its just one millisecond.
local Character = script.Parent
local Humanoid = Character:WaitForChild("Humanoid")
local Animations = {IDLE ANIMATION ID,otheranimid,otheranimid2}
function playAnim(animation)
for i=1,#Animations do
if i == animation then
local a = Humanoid:LoadAnimation(Animations[animation])
a:Play()
end
end
end
function running(spd)
if spd < 0.75 then
playAnim(1)
end
end
Humanoid.Running:Connect(running)
Edits: Improved and fixed code, bold-ed some text NOTE: Remember that you should wait for the track to finish before restarting it (I have not included this in my code so that should be noted).
I don’t know what animation editor that is. However, I can only be sure that it isn’t the problem if you show me the animation track looping while the editor is still open.
you set your animation to loop but is your animation really a loop?
the problem might be that you keyed your animation in a way that you aren’t interpolating back to the original position. this will cause the animation to jump back to the original position, which is what it looks like in the gif.
here's an example:
i don’t have any experience using moon animator and maybe it has its own functions to do this but in the normal plugin you would do:
this
i got rid of the jumping effect by making the last key of the animation into the resting position so that the animation interpolates back to it.
I don’t want it to interpolate, I only want it to stay in the position without making use of manually setting the position and rotation of each part in a script, as its much easier in a animation instead.