How can I Load an Animation After a Different Animation is Played?

I want to create a sitting animation, where it also plays an animation when you get up and sit down. I’m not sure how to script this, at the moment I have an animation playing just for the sit. How would I script/fix this?
image

2 Likes

Try this:

anim:Play() --Sitdown
anim.Stopped:wait()
anim:Play() --sitanim
1 Like

It worked, thanks for responding. (not really)

I belive this is a problem with my animation, but apparently after getting up the character continues to play “sitanim.” My animation is looped already, so is there a way to stop the animation from being looped after getting up? (Here’s an exmaple of what happens):

It is possible, you’d need to listen for the character’s humanoid’s “.Seated” event and determine if they started sitting/stopped sitting, then you’d just need to stop & start whatever animations necessary, here’s an example snippet.

local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")

local sitAnimation = script:WaitForChild("Animation")
local sitTrack = humanoid:LoadAnimation(sitAnimation)

humanoid.Seated:Connect(function(isSeated, seatPart)
	if isSeated then
		sitTrack:Play()
	else
		sitTrack:Stop()
	end
end)

Hopefully this should be simple enough to follow.

1 Like

Sorry that I took a long time to respond, I can understand your script of course but as a beginner scripter (I wouldn’t even consider myself as a scripter) I’m not sure how I can script this to make it work. Here’s what I tried and concidering the incorrections, the script didn’t do anything.