Dummy teleports to a location and not behind the player

I’m making an npc touch you and teleport behind you but every time he touches me, no matter how far away, he always teleports to that place and I don’t know how to fix it.
image

my code here:


local humanoidNPC = script.Parent.Parent.Humanoid
local hrp = script.Parent.Parent.HumanoidRootPart

script.Parent.Touched:Connect(function(hit)
	local humanoid = hit.Parent:FindFirstChild("Humanoid")
	local torso = hit.Parent:FindFirstChild("LowerTorso")
	if humanoid ~= nil and deb == false then
		deb = true
		humanoidNPC.WalkSpeed = 0
		humanoid.WalkSpeed = 0
		hrp.CFrame = CFrame.new(Vector3.new(torso.Position))
		print("Works!!!")
		wait(3)
		humanoid.WalkSpeed = 16
		humanoidNPC.WalkSpeed = 20
		deb = false
	end
end)

Position is already a Vector3, no need to create another Vector3 from it. Also, Can’t you just get the CFrame of the torso instead of having to make a CFrame from the Positin

hrp.CFrame = torso.CFrame
1 Like