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

How can I fix my arms being stuck in this animation? [SOLVED]

Asked by 4 years ago
Edited 4 years ago

I am trying to make a default hands up animation and whenever I first pull out the gun everything is ok, but then when I go to unequip it that is where my problem is.

Here are some Gyazo to show the issue:

https://gyazo.com/e4872aca3f5543b42aff0246777e937d

tool.Equipped:Connect(function(mouse)
    print("Tool equipped!")
    mouse.Icon = "rbxassetid://3982173194"
    local hum = player.Character:FindFirstChild("Humanoid")
    local IdleAnim = hum:LoadAnimation(Animations.Idle)
    IdleAnim:Play()
end)

tool.Unequipped:Connect(function()
    mouse.Icon = ""
    local hum = player.Character:FindFirstChild("Humanoid")
    local IdleAnim = hum:LoadAnimation(Animations.Idle)
    IdleAnim:Stop()
end)

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

My problem was that I was instancing the newer animation,inside the function, creating a new cache or whatever each time.

    local IdleAnim = hum:LoadAnimation(Animations.Idle)

So to solve this I just put this line outside the function, and then called the

:Play() :Stop()

inside the functions.

Ad

Answer this question