Hello, I’m having trouble with animating a character when they equip a tool.
This is what the animation should look like:
And this is the code to play the animation:
local tool = script.Parent
local player = game:GetService("Players").LocalPlayer
local currentAnimation
tool.Equipped:Connect(function()
local humanoid = player.Character.Humanoid
local animation = Instance.new("Animation")
animation.AnimationId = "http://www.roblox.com/asset/?id=10628723137"
currentAnimation = humanoid:LoadAnimation(animation)
currentAnimation:Play()
end)
tool.Unequipped:Connect(function()
currentAnimation:Stop()
end)
However, when I test the game it looks like this:
(arms are farther apart)
I also tried just playing the animation when the player joins but it still changes whenever the gun is equipped:
Any help is appreciated.