What do you want to achieve?
Playing the animation on my custom character after i use LoadAnimation() to load the animation and Play() to play it.
What is the issue?
It isn’t playing and has no errors.
What solutions have you tried so far? I’ve copy and pasted the code from the dev hub to instantly play animations on humanoids.
Here is my code:
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") and hit.Parent.Humanoid.Health ~= 0 then
local humanoid = game.Players.LocalPlayer.Character.Humanoid
humanoid.WalkSpeed = 0
game.ReplicatedStorage.kill:FireServer(hit.Parent.Humanoid)
local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://5250166903"
local anim = humanoid:LoadAnimation(animation)
anim:Play()
wait(3)
humanoid.WalkSpeed = 12
end
end)
It’s run on a localscript and the only part of the code that isn’t working is the Animation part.