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!)