Animation not playing

I made an animation, published it to Roblox, and it doesn’t play. The code is correct, because the code works with my older animation I made. But the animation I made today doesn’t work. I set the priority to Action 3 but id still doesn’t work. Please help.

The animation: https://create.roblox.com/dashboard/creations/marketplace/13016146546/configure

I’m the owner and I just made it today, idk why it’s not playing

2 Likes

Perhaps you uploaded it into a different group or else. Try uploading your work into your roblox profile instead.

1 Like

i uploaded it to my own profile, and I can see that my roblox user is the owner

https://create.roblox.com/marketplace/asset/13016146546/Scatter-Clip-new

Could there be other reasons as to why my animation is not playing?

Edit: There’s no problem with the code because, by changing the animationId, other animations work

1 Like

Well, if that the case.
(1)Try to make the sure that the animation is loaded before playing
(2) If there is idle animation that are looped, try making the animation you created have higher priority than idle ones
(3)Overall, try debugging process

How do I make sure that the animation is loaded?

1 Like
local tool = script.Parent
local animationToLoad = tool:WaitForChild("Animation") 

local character = tool.Parent -- refer to player.Character

tool.Activated:Connect(function() 
    if character ~= nil then
       local loadAnim = character:WaitForChild("Humanoid"):LoadAnimation(animationToload)
       loadAnim:Play()
    end
end)

oh ok, my previous code was doing humanoid.Animator, lemme try using humanoid:LoadAnimation instead

Edit: still doesn’t work, my code does run though because it printed the animationId. By the way, could it be an invalid animation id? The animation id is rbxassetid://13016146546

Should I change it to like roblox.com/asset or something?

1 Like

i changed it to roblox.com/asset but it still doesn’t work, what could be wrong?

1 Like

ur code is a local script or a script?

u can try that

local tool = script.Parent
local animationToLoad = tool:WaitForChild("Animation") 

tool.Activated:Connect(function() 
local character = tool.Parent 
    if character ~= nil then
       local loadAnim = character:WaitForChild("Humanoid"):LoadAnimation(animationToload)
       loadAnim:Play()
    end
end)

change the character variable to when u active the tool

it’s a local script, and I tried that code and it doesn’t work…

can u show me ur code for see that?

lol change this

 local loadAnim = character:WaitForChild("Humanoid"):LoadAnimation(animationToload)

to that

local loadAnim = character:WaitForChild("Humanoid"):LoadAnimation(animationToLoad)

here is the code:

--inside a user input service
local function playAnim(character, animation)
	local humanoid = character:FindFirstChildOfClass("Humanoid")
	if humanoid then
		-- need to use animation object for server access
		local animator = humanoid:FindFirstChildOfClass("Animator")
		if animator then
			local animationTrack = animator:LoadAnimation(animation)
			animationTrack:Play()
			return animationTrack
		end
	end
end

local mineAnim = Instance.new("Animation",workspace)
mineAnim.AnimationId = "rbxassetid://12495659836"

playAnim(plr.Character,mineAnim)

The animation works with an old animation I made last month, but it doesn’t with the one I made today.

u are detecting the character from

game.Player.LocalPlayer.Character

or

script.Parent.Parent -- Which is the parent of the tool
1 Like

I’m getting the character from game.Players.Character, and again, the code works for one animtion but doesn’t for the other animation, theres just a change in the animation id.

1 Like

This perhaps could be an engine bug. Meaning, there would be a possible fix in the future since our solution didn’t work out.

You can perhaps check debug, test and edit the animation and script again till the solution is found.

Sorry if we can’t fix your problem, mate.

wait ur are scripting that in a tool right?

the tool haves handle because u have to desactive require handle in the tool if the tool didnt have?