Npc unable to move when welding a player to it

I have no idea what category do i put it in sorry
I wanted to make an npc that “carries” the player,i tried using weld to do that but it makes the npc unable to move and after i disable the weld it starts moving but glitchy.
Please help i think i’ve done everything i could have.

Explorer model screenshot

AI script

local PathFindingService = game:GetService("PathfindingService")
local Humanoid = script.Parent:WaitForChild("Humanoid")
local Target = workspace.Waypoints.Sweep["10"]
local retryamount = 1

local function ComputePath(startpoint,endpoint)
	local Path = PathFindingService:CreatePath()
	Path:ComputeAsync(startpoint,endpoint)
	
	if Path.Status == Enum.PathStatus.Success then
		return Path
	else
		warn("Unsuccessful path")
		if retryamount < 3 then
			ComputePath()
			retryamount += 1
			warn("Retrying")
		else
			warn("Bruh")
		end
	end
	
	
end

local function Walk(humanoid,startpoint,endpoint)
	local Path = ComputePath(startpoint,endpoint)
	
	local Waypoints = Path:GetWaypoints()
	local CurrentWaypointIndex = 2
	
	MoveToFinishedConnect = Humanoid.MoveToFinished:Connect(function(reached)
		if reached then
			if CurrentWaypointIndex < #Waypoints then
				
				CurrentWaypointIndex += 1
				Humanoid:MoveTo(Waypoints[CurrentWaypointIndex].Position)
			else
				print("Finish Line!")
				MoveToFinishedConnect:Disconnect()
			end
		else
			-- if didnt reach
			MoveToFinishedConnect:Disconnect()
			Walk(humanoid,startpoint,endpoint)
		end
	end)
	
	
	
	humanoid:MoveTo(Waypoints[CurrentWaypointIndex].Position)
	
	
	
end

Walk(Humanoid,script.Parent.HumanoidRootPart.Position,Target.Position)

Script in the “Hitbox” part

local Sweep = script.Parent
local TweenService = game:GetService("TweenService")
local Info = TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.In,0,false)

local SweepWaypoints = workspace.Waypoints.Sweep

local SweepWaypointTable = {}
SweepWaypointTable = SweepWaypoints:GetChildren()

print(SweepWaypointTable[math.random(1,#SweepWaypoints:GetChildren())])


local goals1 = {}

Sweep.Touched:Connect(function(hit)
	if game.Players:FindFirstChild(hit.Parent.Name) or hit.Parent:FindFirstChild("IsACharacter") then
		if hit.Parent:FindFirstChild("SweepWeld") then
			
		else
			hit.Parent.Humanoid.WalkSpeed = 0
			
			
			
			local SweepWeldChr = Instance.new("Weld")
			SweepWeldChr.Name = "SweepWeld"
			SweepWeldChr.Parent = hit.Parent
			SweepWeldChr.Part1 = hit.Parent.HumanoidRootPart
			SweepWeldChr.Part0 = Sweep
			
			
			local JankyEvent = hit.Parent.Torso.Changed:Connect(function()
				hit.Parent.Torso.CanCollide = false
			end)
			task.wait(math.random(999,9999))
			JankyEvent:Disconnect()
			SweepWeldChr.Part0 = nil
			hit.Parent.Humanoid.WalkSpeed = 25
			task.wait(5)
			SweepWeldChr:Destroy()
		end
	end
end)



please help

Thanks in advance.

You can’t weld a Humanoid to another Humanoid, physics gets messed up because both are trying to fight each other.
From what I’ve seen in the forums it’s best to clone the player’s avatar (without the Humanoid) and Weld all those Parts (making them Massless as well) to the NPC.

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