Help with Seat animation

Hiya! So I’m currently trying to make a chair animation as it’s for an upcoming project and I was wondering why the animation does this:

https://gyazo.com/07eef8f03effc04b1f485435d1154c5e

The script that’s been used for the seat is below:

seat = script.Parent
function added(child)
	if (child.className=="Weld") then
		human = child.part1.Parent:FindFirstChild("Humanoid")
		if human ~= nil then
			anim =human:LoadAnimation(seat.sitanim) --replace sitanim with whatever your animation is renamed to in the seat
			anim:Play()
		end
	end
end

function removed(child2)
	if anim ~= nil then
		anim:Stop()
		anim:Remove()
	end
end

seat.ChildAdded:Connect(added)
seat.ChildRemoved:Connect(removed)

Kind regards
oscar

1 Like

You might wanna change it directly from here.

image

The code should be something like that.

Character:WaitForChild("Animate").sit.SitAnim.AnimationId = animID

Make sure you put that in a Player.CharacterAdded event and you’re set.

I’ve not got the values though and I’m not quite sure which ones to get.

It seems to me that you do have the animation instance inside the seat part. From there, you might be able to get the Animation ID which I believe is what you’re looking for.

Wouldn’t that just be the name of the seat though?

You used :LoadAnimation() therefore the parameter inside is an AnimationTrack instance. Through the explorer window, you are able to see the “sitanim” instance in the seat. Click on that and copy the animation ID.

Once you’ve found it, proceed like this:

game.Players.PlayerAdded:connect(function(player)
	player.CharacterAdded:connect(function(character)
		character:WaitForChild("Animate").sit.SitAnim.AnimationId = [ The Animation ID you copied ]
	end)
end)

It still won’t work, is there any chance you know any other scripts that could work?

That’s really odd. I was able to change the sit animation only and purely from the script I provided above: https://gyazo.com/67215055a0040dc087163144f59c0020

Make sure you put the whole URL of the AnimationID like this:

character:WaitForChild(“Animate”).sit.SitAnim.AnimationId = “rbxassetid://5983854043”

Thank you to everyone who tried helping me! Someone has helped me figure out how to get the seat animation to show up and this post will now be closed.

Please do not reply to this thread