Tool Lags Behind To Last Animation Keyframe Before Being Unequipped

Hello. I seem to be encountering a problem that is becoming an inconvenience to my development progress. Whenever I script my own tool and having it animated I usually do it this way:

Character joins the game, I add a motor6D named “Grip” to the character (parented to the torso). My tool’s RequireHandle is turned off.

-- Server script after characterAdded
local gripM6D = Instance.new("Motor6D")
gripM6D.Name = "Grip"
gripM6D.Part0 = torso
gripM6D.Parent = torso

After which, I setup my tool’s equipped function by having the tool connect to the gripM6D by setting its Part1 to the tool’s (custom) handle called “BodyGrip”

-- This connection is done BOTH on the server and client to avoid delays!
tool.Equipped:Connect(function()
	local gripM6D = torso:FindFirstChild("Grip")
	if gripM6D then
		gripM6D.Part1 = tool.BodyGrip
	end
end)

This is the standard set up for my tool-connection. And the setup others are doing as far as I’m concerned. Upon testing, it seems to work; the connection that is.

The problem begins when I start playing an animation once the tool is equipped. For simplicity sake, the final code will look like this:

tool.Equipped:Connect(function()
		
	isEquipped = true
		
	local gripM6D = torso:FindFirstChild("Grip")
	if gripM6D then
		gripM6D.Part1 = tool.BodyGrip
	end
		
	equip:Play(0) -- this is a loaded animation
	equip.Stopped:Connect(function()
		if not isEquipped then return end
		idle:Play() -- another loaded animation
	end)
	
end)
	
	
tool.Unequipped:Connect(function()
		
	isEquipped = false
		
	idle:Stop()
	equip:Stop()
end)

Now when tested the first equip, no issue at all. Once it’s unequipped and reequipped again, the tool begins to lag behind to the last animation keyframe it was in before it was unequipped.

44b9f0bf6b024c4a17eda3d153f83474
problem visible on second equip–it happens more often than what is recorded. Some weird anomaly is that most of the lagging is not being captured by my gyazo recorder, not sure why

Some things I observed:

  • Another thing to note is that if you keep equipping or requipping it happens very frequently, there’s like maybe 1 or 2 in every 10 attempts that it won’t lag behind.
  • In the server’s perspective this doesn’t seem to be the case and works just fine.

Some solutions I tried:

  • removing tool.BodyGrip to the motor6d’s part1 everytime it is unequipped and reconnecting it after
  • deleting the motor6d and replacing it with a new one after
  • some other tweaking like switching the order of the code

Not really sure what causes this. It seems like only a handful of people including myself have been encountering this (we must be doing something wrong?) and I can’t find any solution or atleast one unified solution in any of their posts.

Just wondering if I’m missing something or I’m doing something wrong. I’m really open to getting this problem solved. Been stuck in this issue for a while now. Anybody wanna try in on this see if they have the same problem?