Hello, my recent question has been solved on how to script an animation so it plays when you sit down, however my animation stays for a while and then disappears. Does anyone have an animation loop script? Thanks.
Here's the script:
script.Parent.ChildAdded:Connect(function(c) -- when a child is added (assuming the parent is the seat)
if c:IsA("Weld") and c.Name == "SeatWeld" then -- if the added child is a weld and is named "SeatWeld"
if c.Part1.Parent:FindFirstChildOfClass("Humanoid") then -- if the script finds a humanoid
local anim = Instance.new("Animation") -- makes the animation
anim.AnimationId = "rbxassetid://2521211373" -- sets the id of it
local track = c.Part1.Parent:FindFirstChildOfClass("Humanoid"):LoadAnimation(anim) -- loads the animation
Track.Loop = true
track:Play() -- plays the animation
end
end
end)

2 comments
I'm pretty sure you do that on the animation editor
AnimationTrack.Looped = true