Old Character Steps Forward Slightly When Switching Characters

I made a script that switches your character with another character like Lego Batman. Problem is, the old character takes a few steps forward. If you switch again, the new old character moves forward too, but slightly less, and from then on switching between characters moves the previouse character forward by the same amount.

Anyone familiar with anything in any player scripts which may be causing this?

I litteraly just did a player.Character = (npc model) then since the old model’s parent gets set to nil, i set it back to workspace. Then i move over the animate script from the previouse character to your currenr character and update the camera’s subject.

It probably isn’t a problem with my code directly, rather a side affect of existing core scripts.

I was stationary while switching characters.

But what is your script? Please put the section that deals with the switch.

local RS = game:GetService("ReplicatedStorage")
local switchEvent = RS:WaitForChild("WorldEvents"):WaitForChild("SwitchChar")

local currentChar = script.Parent.Parent.Parent
local currentHum = currentChar.Humanoid

script.Parent.Triggered:Connect(function(player)
	local oldChar = player.Character    --Gets player's character
	oldChar.HumanoidRootPart.Anchored = true
	player.Character = currentChar   --Switches characters <<<<<<<<<<<<<<<<<<
		
	oldChar.Animate.Parent = player.Character
	oldChar.Parent = workspace
	oldChar.HumanoidRootPart.Anchored = false
	switchEvent:FireClient(player) --tells client to update camera subject
	script.Parent.Parent = oldChar.UpperTorso --moves proximity prompt to old char and some stuff for resetting the variables
	
	currentChar = script.Parent.Parent.Parent
	currentHum = currentChar.Humanoid
end)