How to make animations play using KeyframeSequenceProvider?

how to make animations play using KeyframeSequenceProvider?

It’s really hard and confusing

or like get the ID

The best explanation has already been provided on the roblox developer wiki: KeyframeSequenceProvider | Documentation - Roblox Creator Hub

If you are trying to make animations play in a game (where you probably don’t want to use KeyframeSequenceProvider), this article should have you covered:

Here’s an example, how to play an animation without publishing it:

local animation = Humanoid:LoadAnimation(KeyframeSequenceProvider:RegisterKeyframeSequence(keyframeSequence))
animation:Play()

That function basically gives a temp id that you can load inside humanoids

where would I put that script? and what if the KeyframeSequenceProvider has a custom name?

It depends on your needs, I’ll make the script more clear:

local Humanoid = pathToHumanoid
local keyframeSequence = pathToAnimSave
local KeyframeSequenceProvider = game:GetService("KeyframeSequenceProvider")
local animation = Humanoid:LoadAnimation(KeyframeSequenceProvider:RegisterKeyframeSequence(keyframeSequence))
animation:Play()

how would I make the animation play if I touched the part? using what u said.

You may need to use this as reference and put the play animation code inside the function with a cooldown.

script.Parent.Touched:Connect(function(p)
if p.Parent:FindFirstChild("Handler") then
---Code  here
end
end)

this is my script

You may check if the part.Parent is a player character by using the function GetPlayerFromCharacter() then run the code.