I have a long jump animation, but if the player long jumps the animation doesn't stop when a part is touched and doesn't take the player to that part either, how do i fix this?? THE SCRIPT:

local player = game.Players.LocalPlayer
 
repeat wait() until player.Character.Humanoid 

local humanoid = player.Character.Humanoid
 

local mouse = player:GetMouse()



 

local anim = Instance.new("Animation")


anim.AnimationId = "http://www.roblox.com/asset/?id=1491234078" -- id of animation



 

=mouse.KeyDown:connect(function(key)

 

    if key == "z" then --Select a button, if you want shift then put 48 in it
 

        local playAnim = humanoid:LoadAnimation(anim)


        playAnim:Play()

   end

end)

thanks for your help

1 comment

0

Are you saying your animation loops(plays over and over)? And to make player move to where they are at the end of the jump just get their HumanoidRootPart.CFrame at the end of the jump then set their HumanoidRootPart.CFrame to that to move them to that spot them stop the animation