Weird animations bug

My tools show their animations, but weirdly. I usually preload the animations in the script and then play them and stop them, but I think that may be the issue with this problem. I have 2 tools and both have their own animations, when I try the tools the animations in the animator are most likely being played from the other tool.

I tried renaming the animations so they don’t have the same name when preloaded, but that didn’t work.

I would like to hear a better option to play these animations without them interfering.

Yes, both tools use the same script only changing in some parts, of course, also this script is a bit longer but I don’t want to share the whole script. This is simply just a cut-out part.

local equipAnimationPreload = player.Character:FindFirstChild("Humanoid").Animator:LoadAnimation(animations:FindFirstChild("Equip"))
local idleAnimationPreload = player.Character:FindFirstChild("Humanoid").Animator:LoadAnimation(animations:FindFirstChild("Idle"))
local holsterAnimationPreload = player.Character:FindFirstChild("Humanoid").Animator:LoadAnimation(animations:FindFirstChild("Holster"))
local fireAnimationPreload = player.Character:FindFirstChild("Humanoid").Animator:LoadAnimation(animations:FindFirstChild("Fire"))
-------------- - --------------
local replicatedStorage = game.ReplicatedStorage
local WeaponModule = require(replicatedStorage.WeaponSystem)
-------------- - --------------

tool.Equipped:Connect(function()
	sounds.Equip:Play()
	WeaponModule.onEquip()
	equipAnimationPreload:Play()

	player.PlayerGui:FindFirstChild("AmmoGui").MainFrame.AmmoLeft.Text = ammo
	player.PlayerGui:FindFirstChild("AmmoGui").MainFrame.MaxAmmo.Text = maxAmmo
	wait(equipAnimationPreload.Length)
	idleAnimationPreload:Play()
end)

tool.Unequipped:Connect(function()
	WeaponModule.onUnequip()
	reloadAnimationPreload:Stop()
	equipAnimationPreload:Stop()
	idleAnimationPreload:Stop()
	holsterAnimationPreload:Stop()
	fireAnimationPreload:Stop()
end)````

It’ll be very useful to have a video of the issue

This is a video with disabled other tool scripts (won’t preload animations from other tool):

This is a video with enabled other tool scripts (will preload animations from other tool):

change holster animation priority to priority above the idle/shoot, i heard theres another hacky way but forgot how to do it

Tried that, but it doesn’t work.

I have rescripted the code a bit, it was a GUI issue.

1 Like

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