Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

What is Invalid animation id '<error: unknown AssetId protocol>?

I was writing a running script and when I tried to add animations to it I get this error

Invalid animation id '<error: unknown AssetId protocol>':

I don't know what I did wrong but here is the script

local players = game.Players.LocalPlayer
local character = players.Character
local UIS = game:GetService("UserInputService")
local speed = 27

UIS.InputBegan:Connect(function(key)
	if key.KeyCode == Enum.KeyCode.LeftShift then
	character.Humanoid.WalkSpeed = speed
	local Anim = Instance.new("Animation")
	Anim.AnimationId = 'rbxassitid://2217747028'
	local PlayRunAnim = character.Humanoid:LoadAnimation(Anim)
	PlayRunAnim:Play()
	end
end)

UIS.InputEnded:Connect(function(key)
	if key.KeyCode == Enum.KeyCode.LeftShift then
		character.Humanoid.WalkSpeed = 16
	end
end)

2 comments

0

Change 'rbxassitid://2217747028' to 'rbxassetid://2217747028'

0

THankyou! I was using rbxasset.id this whole time..

2 answers

✓ Accepted answer

'rbxassitid://2217747028' this is wrong, not assitid, its assetid

Use this:

local players = game.Players.LocalPlayer or game.Players.PlayerAdded:Wait()
local character = players.Character or players.CharacterAdded:Wait()
local UIS = game:GetService("UserInputService")
local speed = 27

UIS.InputBegan:Connect(function(key)
    if key.KeyCode == Enum.KeyCode.LeftShift then
    character.Humanoid.WalkSpeed = speed
    local Anim = Instance.new("Animation")
    Anim.AnimationId = 'rbxassetid://2217747028'
    local PlayRunAnim = character.Humanoid:LoadAnimation(Anim)
    PlayRunAnim:Play()
    end
end)

UIS.InputEnded:Connect(function(key)
    if key.KeyCode == Enum.KeyCode.LeftShift then
        character.Humanoid.WalkSpeed = 16
    end
end)

ok so i think you have a problem with your animations priority. i struggled with this quite a lot in the past and recently found out how to fix it all you have to do is go to your animaion plugin and then import the animation you want in the editor from there you open the edit tab and look for the "priprity" setting. you will have to set it to "action"

if this helped you please accept my answer. have a nkce day

1 comment

0

priority*

This discussion is preserved as it was. New answers, comments, and votes are closed.