Animation Not Working

I’m In a team create with a friend and the animation isn’t working.
heres my code:

local UserInputService = game:GetService("UserInputService")
local plr = game.Players.LocalPlayer
local char = plr.Character
UserInputService.InputBegan:Connect(function(Input, isTyping)
	if isTyping then
		return
	end
	if Input.KeyCode  == Enum.KeyCode["V"] then
		local Anim = Instance.new("Animation")
		Anim.AnimationId = "rbxassetid://5506700650"
		local TheLoadedAnim = char.Humanoid:LoadAnimation(Anim)
		TheLoadedAnim:Play()
	end
end)

It would be wonderful if you could help me find the error.

Well, for starters you don’t need to make a new animation instance every time and load it everytime. So I would move from local Anim to :LoadAnimatio(... out of the UIS InputBegan function.

I don’t know if that is the full reason it doesn’t work, but it may be.

Maybe try adding a print for when you do the KeyCode check to make the sure it is detecting the key

Also, I can’t ever remember but you may have got the isTyping backwards, try putting it as if not isTyping then (this is probably wrong because I can never remember Game Processing)

Use the humanoid animator to animate characters, since loading animations on the humanoid has been deprecated. Do not use this for new works. Also check if the animation is your property, if it is not, it will not work.

Oh, its my friends property. The friend I’m team creating with in his game.

it works just fine in my own game but oddly enough not his with his animation.

Ohhhh, this is an ownership issue. If you guys are developing on team create animations have to be uploaded by the game owner. Had this issue happen to me a couple months ago.

Ye but the account the animation is uploaded on is the game owner.

Well you said it works with your animation but not his, may be a studio bug? Try playing it in a regular server to see if you can see it.

Could It be that his animation has the wrong animation priority set? If his is set to core or idle it might not play. Also could you add some print statements to see if the code breaks anywhere?

“it works just fine in my own game but oddly enough not his with his animation.”

Did he change the animation id to his own animation when he published it on his game?

No, It still doesn’t work in studio, but it works perfectly fine in game.

Could you check what the animation Priority is? Also any errors?

Seems just like a Studio glitch to me.

I don’t know, it’s a different animation so many things could have gone wrong. Different animation priority, maybe your friend had the wrong animation id etc. Check for errors, if it isn’t a Studio glitch then the error will tell you what is the problem.

There are no errors. Currently.