I made a simple animation and it works fine on rigs but when i try using it on a player it wont work, and it wont give any errors, this code is just a test on a local script but even normal scripts wont make it work (i barely worked with animations so im not sure what i did wrong)
local UIS = game:GetService("UserInputService")
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local animation = character.Animation
local humanoid = character.Humanoid
UIS.InputBegan:Connect(function(input, GPE)
if input.KeyCode == Enum.KeyCode.P then
animation.AnimationId = "rbxassetid://127068582200241"
local Track = humanoid:LoadAnimation(animation)
Track:Play()
print("playing animation")
end
end)