My animation doesn't work

Hello!

I’ve been trying for 1 hour to get an animation to run when pressing the F key, but the animation never plays no matter how many times I try.

The animation was created by me, the priority is in action, the game is created in a group, but the group is mine, so I don’t think it’s a permission problem.

Before posting this I have been searching Google for a long time without much success.

This is my code:

local player = game:GetService("Players").LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local UserInputService = game:GetService("UserInputService")
local debounceF = false

--Keys
local keyF = Enum.KeyCode.F


local function KeyFPressed()
	return UserInputService:IsKeyDown(keyF)
end


local function Input(input, gameProcessedEvent)
	if not KeyFPressed() then
		--Nothing
	else
		if (game.Workspace:FindFirstChild(player.Name)) and (game.Workspace[player.Name]:FindFirstChild("Head")) and (game.Players:FindFirstChild(player.Name)) then
			if (debounceF == false) then
				debounceF = true
				--Animation
				local animation = Instance.new("Animation")
				animation.AnimationId = "rbxassetid://6009915700"

				local track = character:WaitForChild("Humanoid"):LoadAnimation(animation)
				track:Play()
				wait(1)
				debounceF = false
			end
		end
	end
end

UserInputService.InputBegan:Connect(Input)

try loading the animation on the animator

Okay, I’m very stupid.

The solution was to do the animation in R15 instead of R6.