Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

My animation trigger is buggy, how do i fix it?

Asked by 6 years ago

I want to trigger an animation for my adventure game, it needs to trigger when you step on the part but the problem is: when you step on the part it doesn't do anything or the animation stops at a random point, how do I fix this?

THIS IS THE SCRIPT: local Anim = script:WaitForChild("Animation") local debounce = false

script.Parent.Touched:Connect(function(hit) if (not debounce) and hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") and hit.Parent.Humanoid:FindFirstChild("Animator") and hit.Parent:FindFirstChild("HumanoidRootPart") then debounce = true local track = hit.Parent.Humanoid.Animator:LoadAnimation(Anim) track:Play()

end

end)

Also, when the player jumps/falls the animation just stops, how do i fix this.

Thanks for your help! (if you could help me!)

0
To make your animation play even when player jumps/falls in the animation editor go to edit set priority and select "Action". TheGreatSailor 20 — 6y

Answer this question