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

Animation Not Playing Fully?

Asked by
Azuc 112
6 years ago

So I created a custom sitting animation using the animation editor, basically when you sit on a couch im wanting it to lean you back and place your arms kinda to your sides and w/e.

So I made the animation for that but when you sit on the seat, the animation plays for like .2 seconds then it just goes to the normal sitting animation.

Code attached.

seat = script.Parent
function added(child)
    if (child.className=="Weld") then
        local human = child.part1.Parent:FindFirstChild("Humanoid")
        if human ~= nil then
            anim = human:LoadAnimation(seat.sitanim)
            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)
0
I would just change the players sitting animation and then change it back to the original in the function removed Unbunn_makes 48 — 6y
0
I'm pretty sure that this isn't an issue with your code instead it's with the animate code inside the character, what you should try is to change the sitting animation by going to the animate script's children and go to the specific one that says sitting and change it to your animation id then change it back when the function is removed Unbunn_makes 48 — 6y
0
:Destroy() please :Remove() is deprecated GingeyLol 338 — 6y
0
change the animations priority in the editor to action Kimuyo 13 — 6y
0
oh and make sure it's looping Kimuyo 13 — 6y

Answer this question