Keep getting error "Invalid animation id '<error: unknown AssetId protocol>': "

I want to play an animation from a gun tool onto a character.

It keeps throwing the error Invalid animation id ‘<error: unknown AssetId protocol>’: at line 41, where it has just

tool.Equipped:Connect(function()
	idleAnim:Play()
	equipped = true
end) -- This is line 41

I tried to copy and paste a basic animationId template and replace it with my digits, but it isn’t working. Here is my code:


local idleAnim = Instance.new("Animation", script.Parent)

idleAnim.AnimationId = "rbxassetid://131653501889264"

local idleAnimLoad = animator:LoadAnimation(idleAnim)

tool.Equipped:Connect(function()
	idleAnim:Play()
	equipped = true
end) -- This is line 41

tool.Unequipped:Connect(function()
	idleAnim:Stop()
	equipped = false
end)

Any help would be appreciated!

Erm… Shouldn’t these be idleAnimLoad :nerd: :index_pointing_up:

Edit: But actually, how did you not get an error when you’re trying to use a non-existing method on the Animation?

I don’t know, I think it’s a problem with the rbxaasetid animationID that prevents the rest of the code from running

Why don’t you try putting the animation under the script and then use it from there?

Okay I’ll use it when I get home (I’m on mobile right now)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.