Animation bug/problem

I created sword holding script. For a less than a second, hand are together but after, they seperate (as shown in the picture)
image

Heres the script

local player = game.Players.LocalPlayer
local humanoid = player.Character:FindFirstChild("Humanoid")
local Idleanim = humanoid:LoadAnimation(script.Parent.Idle)

script.Parent.Equipped:Connect(function()
	Idleanim.Priority = Enum.AnimationPriority.Idle
	Idleanim:Play()
	
end)

script.Parent.Unequipped:Connect(function()
	Idleanim:Stop()
end)

Any idea what can cause this?

The animation wasn’t set to looped when you created it?

1 Like

No, it wasnt. May that be the reason its happening?\

This is because the animation priority is too low and it’s clashing with the default idle animation. You can read about them here: AnimationPriority | Documentation - Roblox Creator Hub

local player = game.Players.LocalPlayer
local humanoid = player.Character:FindFirstChild("Humanoid")
local Idleanim = humanoid:LoadAnimation(script.Parent.Idle)

script.Parent.Equipped:Connect(function()
	Idleanim.Looped = true
	Idleanim.Priority = Enum.AnimationPriority.Action
	Idleanim:Play()
	
end)

script.Parent.Unequipped:Connect(function()
	Idleanim:Stop()
end)

So, it should be fixed after bumping it up a few levels.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.