Idle Animation not wanting to work?

Hello! I am trying to figure out why this Idle Animation doesn’t want to work. I am not a very knowledgeable person of animating but I sometimes know my way around.

I have made an Animation, Set the priority to Idle and looped it. Which in that case should look like this when I equip it.

What I am really trying to just go for is a basic Weapon holding in the air sorta like this.

Also NOTE, I do have the tool edited with the tool grip editor.

After all that when I seem to equip, it simply just does this normal tool holding animation.
image

Any help would be much appreciated :smiley:

Did you make a script to play the animation when it is equipped?

I did yes, I recently just tried a Free Model Script, Good news it works but the bad news is that it takes about 3-5 seconds before it actually starts to idle.

What does the code contain if I may ask?

Edit: Also I’m not sure if this was the right category to post this to

I wasn’t sure what category I am supposed to post for “Animations” Specifically.

But this is what I used for the code.

>     local player = game.Players.LocalPlayer
> 
>     repeat wait(1) until player.Character
> 
>     local character = player.Character
> 
>     local humanoid = character:WaitForChild("Humanoid")
> 
>     local animation = Instance.new("Animation")
> 
>     animation.Name = "Idle"
> 
>     animation.Parent = script.Parent
> 
>     animation.AnimationId = "http://www.roblox.com/asset/?id=ANIMID"
> 
>     local animtrack = humanoid:LoadAnimation(animation)
> 
>     script.Parent.Equipped:connect(function()
> 
>     animtrack:Play()
> 
>     end)
> 
>     script.Parent.Unequipped:connect(function()
> 
>     animtrack:Stop()
> 
>     end)

Try this

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local animator = humanoid:FindFirstChild("Animator")
local animation = Instance.new("Animation")
animation.Name = "Idle"
animation.Parent = script.Parent
animation.AnimationId = "http://www.roblox.com/asset/?id=ANIMID"
local animtrack = animator:LoadAnimation(animation)

script.Parent.Equipped:connect(function()
	animtrack:Play()
end)
script.Parent.Unequipped:connect(function()
	animtrack:Stop()
end)

There’s a built-in event for the player instance that’ll wait for the character to be fully loaded, no need for that repeat while loop

Roger that! Thank you! :smiley:

1 Like

Anytime! If you have anymore issues don’t be afraid to make another post!

1 Like