For the last month or so I have struggled with this problem. I am using a module I made for my cut scenes but to animate I teleport the character to the place where the animation has progressed, so the player dost go back to where he was before the animation.
For instance if I wanted a character to walk over to a place and them jump. I would run the walkAnimation and then so the character doesn’t bounce back at the end of the animation, I teleport the character(with SetPrimaryPartCFrame) to the pose where the animation ended. This way I can just play the jump animation and the character is at the same place. However the problem is I can never time the teleport with the end of the animation, so there is always a flicker.
See:
My code is super complex but this is the executed part:
for i,v in ipairs(Character.Value.Humanoid:GetPlayingAnimationTracks()) do --Stoping all playing animations
v:Stop()
end
local Animation = Character.Value.Humanoid:LoadAnimation(Animation) -- Geting the Animation tract
repeat wait(0.05) until Animation.Length ~= 0 -- Waiting for animation to load
Animation:Play()
while wait() do -- waiting until animation almost over
print(Animation.TimePosition)
if Animation.TimePosition > Animation.Length - 0.1 then
break
end
end
Animation:Stop()
Character.Value:SetPrimaryPartCFrame(AfterTorsoPosePartCFrame)