so i got a script in starterpack when a player press T it is supposed to play the animation but it doesn't but T pressed, loaded, and played all print out ,yes i am new to animation script:

local player = game.Players.LocalPlayer
repeat wait() until player.Character.Humanoid
local humanoid = player.Character.Humanoid
local UIS = game:GetService("UserInputService")
local anim = script.Animation

UIS.InputBegan:Connect(function(input,gameProcessed)
	if input.UserInputType == Enum.UserInputType.Keyboard then
		if input.KeyCode == Enum.KeyCode.T then
			print("T pressed")
		local playAnim = humanoid:LoadAnimation(anim)
		print("loaded")
		playAnim:Play()
		print("played")
		end
	end
end)

5 comments

0

It's likely an issue with your animation. The priority is probably too low

0

Also you don't need to check if the input type is keyboard, and don't repeat wait() until something exists

0

i guess its my animation i threw it into an npc that already had a working animation and he didnt do anything and i edited the script a bit with the same results as last time

0

the first time the npc played the animation for a split second and then did nothing

0

tried with official roblox animations and still the same result