So I’m trying to make animations for Seat parts, and while it does work, it doesn’t how I want it to. I was following along to a tutorial off Youtube, on how to make seat animations, but now that I’ve done the seat, script and animation, I’ve combined it, and while it does play a sitting animation when you sit, it doesn’t play it properly. I’ve looked on the Roblox website, and the animation is fine, but in studio it doesn’t play how it should. Here is what it’s meant to look like:
I think it might be the script because it shows something is wrong with the red underline, but if the script was broken, then how is the animation working and broken instead of playing the default sitting animation. I have tried fixing it but I don’t know how to script, I have tried re-linking the asset ID, deleting the animation, changing the animation and multiple testings. But it still plays the same animation.
If you want a look a the script, here it is, and any support and help is highly appreciated.
That red line is because you didn’t use local, however, it’s not the problem. Maybe you forgot to add the character’s right and left arm when you created the animation.
I’m going to fix the first issue in a second, but if your second point is invalid. The legs and torso are positioned differently in the broken animation compared to the intended animation as the intended animation’s torso is more angled back and the legs are more angled and spread apart.
I changed it to action 4 and it didn’t work. I did re-link the asset ID and re-open Roblox Studio but it didn’t change, but I will try with idle priority though.
local seat = script.Parent
local animation = seat.sitanim
local track = nil
seat:GetPropertyChangedSignal("Occupant"):Connect(function()
if seat.Occupant == nil then
if track then track = nil return end
end
local humanoid = seat.Occupant
track = humanoid:LoadAnimation(animation)
track:Play()
end)
I was struggling a lot but after more fidgeting I imported the broken animation, changed it to action 4, and exported as a new animation. It turns out it worked and you were right, so for that I thank you.