Animation is not playing

Can someone help me to fix this

so basically my animation is not playing idk why

local Player = game.Players.LocalPlayer

local Character = Player.Character or Player.CharacterAdded:Wait()

local Humanoid = Character:WaitForChild("Humanoid")

-- Animation

local Roll = game.ReplicatedStorage.ClientAnimations.Roll

script.Parent.Equipped:Connect(function()

local RollAnimationTrack = Humanoid.Animator:LoadAnimation(Roll)

script.Parent.Activated:Connect(function()

RollAnimationTrack:Play()

end)

end)

I even tried to make the animation play serversided but still got the same problem

local Player = (script.Parent:FindFirstAncestorWhichIsA("Model") or script.Parent:FindFirstAncestorWhichIsA("Player"))


-- Animation
local Roll = game.ReplicatedStorage.ClientAnimations.Roll


script.Parent.Equipped:Connect(function()
	local RollAnimationTrack = Player.Character.Humanoid:LoadAnimation(Roll)
	script.Parent.Activated:Connect(function()
		RollAnimationTrack:Play()
	end)	
end)
1 Like

Are you getting any errors in output?

1 Like

Is the animation owned by you?

2 Likes

There’s no error in output + i own the animation

1 Like

Can you try this script and see is there trouble with your print function? if there is no error so give the last text of your print function in output. when you activate your tool

print("Game Started")

local Player = game.Players.LocalPlayer
print("Get Player ".. Player.Name)

local Character = Player.Character or Player.CharacterAdded:Wait()
print("Get Character ".. Character.Name)

local Humanoid = Character:WaitForChild("Humanoid")
print("Get Humanoid ".. Humanoid.Name)

-- Animation

local Roll = game.ReplicatedStorage.ClientAnimations.Roll
print("Get Animation ".. Roll.AnimationId)

script.Parent.Equipped:Connect(function()
	print("Tool Equiped")

	local RollAnimationTrack = Humanoid.Animator:LoadAnimation(Roll)
	print("Load Animation")

	script.Parent.Activated:Connect(function()
		print("Tool Activated")

		RollAnimationTrack:Play()
		print("Animation Play")

	end)

end)

but if print function works fine then the problem is probably about your animation did you forget to add animation id or invalid animation id?

1 Like

Yes, it is uploaded to you, but do you own the game? Or is it uploaded to a group

1 Like

Try this one

Local character = script.Parent.Parent
Local RollAnimationTrack

script.Parent.Activated:Connect(function()
if RollAnimationTrack then
RollAnimationTrack = character.Humanoid:LoadAnimation(Roll)
RollAnimationTrack:Play()
end
end)

If not working I’ll find out later

Nope, theres a uppercase at the start of “local”

local character = script.Parent.Parent
local RollAnimationTrack

script.Parent.Activated:Connect(function()
if RollAnimationTrack then
RollAnimationTrack = character.Humanoid:LoadAnimation(Roll)
RollAnimationTrack:Play()
else
warn("No roll animation track!")
end
end)

If it’s not working I’ll find out later. DM for any bugs

Check your animation priority.

1 Like

make a new animation instance with the roll Animation ID and then run it thru the animator

local RollAnim = Instance.new("Animation")
RollAnim.AnimationID = "rbxassetid://blahblahblah"

I think this one okay.

local tool = script.Parent
local anim = Instance.new("Animation")
anim.AnimationId = "http://www.roblox.com/Asset?ID=urcrappyanimationid" 
local track
tool.Activated:Connect(function()
    track = script.Parent.Parent.Humanoid:LoadAnimation(anim)
    track.Priority = Enum.AnimationPriority.Action
    track:Play()
end)

This one work, can play anytime even you resets. Proof is below
https://gyazo.com/ad9d50b9cc1dcca965c77b07bf304d8f

don’t ask why my character is different than my profile + Spinning gorilla lmao