Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Finished making my animation, how do I loop my animation?

Asked by
o_Khoi 4
5 years ago
Edited 5 years ago

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)
0
I'm pretty sure you do that on the animation editor SirDerpyHerp 262 — 5y
0
AnimationTrack.Looped = true arshad145 392 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

Import your animation onto the Animation Plugin you're using, click edit at the top and Set Priority to Action, then press Edit again and Set Looping to true, Finally export animation to override the one you previously made.

Ad

Answer this question