Different Sit Animation For Every Seat

I want to make it so that there is a unique sitting animation for every seat but I can’t find any.
I have tried Xiousa’s script here:

local Seat = script.Parent
local Animation = script:WaitForChild("Animation")
Seat.Changed:connect(function() --You can get the individual property changed event, but this is simpler.
     if Seat.Occupant ~= nil then
          local Track = Seat.Occupant.Humanoid:LoadAnimation(Animation) --Load the animation
          Track:Play() --Play the animation
          Seat.Occupant.Humanoid.Jumped:wait() --Wait for player to leave the seat
          Track:Stop() --Stop the animation
     end
end)

from this thread: Specific seat animation
But it doesn’t work.

7 Likes

Did you change the animation id? Is there anything in the output like animation is not a valid member of script?

image

yes, that’s the problem. you need to put an animation inside of the script and give it an animation id

do you mean an animation inside this
image because if so i do have one inside it

inside of the script, not the script’s parent.

1 Like

I found a solution from here: https://scriptinghelpers.org/questions/94551/specific-sitting-animation-for-certain-seat-like-on-vibe-train

local sitAnim = 2225298712
local seat = script.Parent --Link this to the seat
local playingAnim 

local newAnim = Instance.new('Animation')
newAnim.AnimationId = 'rbxassetid://'..sitAnim

seat.Changed:Connect(function(property)
    if property == 'Occupant' then
        local occupant = seat.Occupant
        if not occupant then if playingAnim then playingAnim:Stop() return end end
        playingAnim = occupant:LoadAnimation(newAnim)
        playingAnim:Play()
    end
end)
--solution
10 Likes

I tried this script and it does not work. I checked the output and it keeps saying " Animation “https://assetdelivery.roblox.com/v1/asset?id=2225298712222529871&serverplaceid=0” failed to load in “Animation.AnimationId”: Animation failed to load" Can anyone help me please?