Dunno why but for whatever reason my animation doesn’t seem to play whenever I sit on the seat object.
My code has no errors. I set priority to Action (highest priority so wouldn’t it just overwrite others like the default one)
local animation = game:GetService("ReplicatedStorage").KamiSitGood
local seat = script.Parent
seat:GetPropertyChangedSignal("Occupant"):Connect(function()
local humanoid = script.Parent.Occupant
if humanoid ~= nil then
local animator = humanoid
for _, playingTracks in pairs(humanoid:GetPlayingAnimationTracks()) do
playingTracks:Stop()
end
local track = animator:LoadAnimation(animation)
track:Play()
end
end)
All the other topics talk about moving animations to the group or something similar, however, mine already are in the group.
I have helped this similar solution many times and all those times have worked for others, so I think it should work for you as well
If your game is R15, try this out
local seat = script.Parent
local animId = game:GetService("ReplicatedStorage").KamiSitGood.AnimationId
local defaultAnim = "http://www.roblox.com/asset/?id=2506281703"
local formeroccupant
seat:GetPropertyChangedSignal("Occupant"):Connect(function()
local humanoid = seat.Occupant
if humanoid then
local char = humanoid.Parent
char.Animate.sit.SitAnim.AnimationId = animId
formeroccupant = char
else
formeroccupant.Animate.sit.SitAnim.AnimationId = defaultAnim
formeroccupant = nil
end
end)
It’ll just change the sitting animation directly instead of playing an animation and then revert it back once you’re off
If your game is R6, I should have a similar code block that should work for R6 games here
If it still doesn’t work, are you certain you inputted the correct id and all?