I am trying to play an animation when I press the letter Q; however, the animation is not playing, there are no errors presented. I have put in print statements to test if my code is running correctly and both statements go through. I do not know if I made a typo or something as I am still learning lua
My code is a local script inside the starterplayerscripts folder
local UIS = game:GetService("UserInputService")
local plr = game.Players.LocalPlayer
local Char = plr.Character or plr.CharacterAdded:Wait()
local wandAnimation = Instance.new("Animation")
wandAnimation.AnimationId = "rbxassetid://12725590286"
UIS.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.Q then
print("q was pressed")
local LoadAnimation = Char.Humanoid:LoadAnimation(wandAnimation)
LoadAnimation:Play()
print("finished")
end
end)
Solution for those viewing this thread in the future: Go to game settings and make sure that animations is NOT set to player choice and body type is set to whatever type you animated your rig in. Hope this helped you
Well I mean if you have it on the right priority (which you do) the only other thing that could be wrong is that the ID is wrong. I’m honestly not sure what else it would be.