R6 Animation not working

I am working on a punch animation, but it says that the animation is ‘invalid’.

Here is my source:

local _d = require(script._d)

local Services = 
	{
		UIS = game:GetService('UserInputService')
	}

local PlrChar = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()

local Animator = PlrChar:WaitForChild('Humanoid'):FindFirstChildWhichIsA('Animator')

local aPunch = Instance.new('Animation')
aPunch.AnimationId = _d._PunchAnim

local LoadedAnims =
	{
		Punch = Animator:LoadAnimation(aPunch)
	}


Services.UIS.InputBegan:Connect(function(iO,gPe)
	if not gPe and iO.KeyCode == Enum.KeyCode.F then
		if game.ReplicatedStorage.Vals._GameActive then
			_d._Event:FireServer()
			LoadedAnims.Punch:Play()
		end
	end
end)

And here is the animation: PunchAnim - Roblox

By any chance you are working on a “group” game and you are using this animation you made previously from your own games?

No, I am a solo dev and the game is entirely made by me (no team create either)

Is the _PunchAnim supposed to have the underscore before it? Should it be _d.PunchAnim? Better yet, put in the actual ID number instead.

Yes, it is meant to, and I put a link to the animation which the ID can easily be gotten from.

But here is the content to _d:

is the model anchored? If so, unanchor it

No, the Player’s character is not anchored.

Did the script give any errors?

Like I mentioned in the post, the error was that the id was ‘invalid’.
image
But it is a published animation made by me that I am using on a game made by myself.

What are you using as the animation ID?

The Animation ID? I already posted it in the replies of this post, please check before asking!

I think I see the problem (also it is easier for me to fix it when I can copy it).
Try making this the ID: “rbxassetid://9413447805”

1 Like

Umm ok i guess u didnt try that first?

It takes in a string, not a number. So no point trying something that wouldn’t work.

Yes i assumed you knew how to add in a string containing the number.