Help with animation

warning I am very very noob at animations

I am trying to make a zombie climb out animation. This is what I am doing step by step:

  • Position the Zombie on the mound of dirt
    image
  • Set the first keyframe of the animation so that the zombie is under the dirt
    image
  • Set the last keyframe of the animation to the zombie standing on the dirt
    image

Then I run this in a script

zombie.Parent = workspace
zombie:PivotTo(dirt.CFrame + Vector3.new(0,dirt.Size.Y/2,0))
local animationTrack = zombie.Humanoid:LoadAnimation(ClimbOutAnimation)

animationTrack:Play()

The problem is that for a split second you can see the zombie above ground before the animation starts playing and it gets teleported below the ground.

I’ve also tried starting with the position of the zombie in the ground and have an animation of it rising out and then after the animation finishes teleport the zombie to the top. But then I have the inverse problem where the zombie rises up nicely and once the animation finishes, it teleports back under the dirt for a split second and then teleports back above the dirt.

What do I do?

I think its because the animation did not load.

You could do this:

local animationTrack = zombie.Humanoid:LoadAnimation(ClimbOutAnimation)
repeat task.wait() until animationTrack.Length > 0
zombie.Parent = workspace
animationTrack:Play()

I’m not sure if there is a animationTrack.Loaded event but I dont think so

This can’t be the reason because

1 Like

Ah yes sorry my mistake I didnt read this.
I’m not that good with animations sorry.

So the problem is after the animation finishes, it “teleports” back to the original position (because the PrimaryPart didnt move) and then you pivot it to the new position (above the ground).
Sadly you cant animate the PrimaryPart I think.

I found this:

“Razorter” made a nice post on this, scroll down to find it.

1 Like