Why does this script glitch my camera?

I have a script that plays an animation on a tool when equipped, but it affects my camera somehow?

The script:

local tool = script.Parent
local hum = tool.Design:WaitForChild("Humanoid")
local animator = hum:WaitForChild("Animator")

local globalAnimation = nil

tool.Equipped:Connect(function()
	local anim = animator:LoadAnimation(script.SpinAnimation)
	globalAnimation = anim
	
	anim:Play()
end)

tool.Unequipped:Connect(function()
	if globalAnimation ~= nil then
		globalAnimation:Stop()
	end
end)


2 Likes

I think it has to do with multiple humanoids in the character, best thing id to make the animation a part of the character by rigging it to the character.

3 Likes

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