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.
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.
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?
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.