NPC won't move even though its unanchored

The model is unanchored and has a humanoid walk speed of 16.
The code to move the NPC is the same as the one Roblox provides: Character Pathfinding | Documentation - Roblox Creator Hub

https://streamable.com/u0vhmn

don’t mind the music

Any idea why?

3 Likes

Can you instead show the code in this post, so I can see what’s wrong?

	local success, errorMessage = pcall(function()
		path:ComputeAsync(GhostModel.PrimaryPart.Position, destination)
	end)

	if success and path.Status == Enum.PathStatus.Success then
		print("Path Success")
		waypoints = path:GetWaypoints()

		blockedConnection = path.Blocked:Connect(function(blockedWaypointIndex)
			if blockedWaypointIndex >= nextWaypointIndex then
				blockedConnection:Disconnect()
				followPath(destination)
			end
		end)

		if not reachedConnection then
			reachedConnection = GhostHumanoid.MoveToFinished:Connect(function(reached)
				if reached and nextWaypointIndex < #waypoints then
					nextWaypointIndex += 1
					GhostHumanoid:MoveTo(waypoints[nextWaypointIndex].Position)
					isWalking = true
				else
					reachedConnection:Disconnect()
					blockedConnection:Disconnect()
					isWalking = false
				end
			end)
		end

		nextWaypointIndex = 2
		GhostHumanoid:MoveTo(waypoints[nextWaypointIndex].Position)
	elseif errorMessage then
		warn("Path not computed!", errorMessage)
		isWalking = false
	end
end
1 Like

Does it print Path success whatsoever?

Yep In the video I do show it in the output

You’re checking if a waypoint is blocked, then deleting it? Where is the humanoid meant to know where to go?

1 Like

Uh it doesn’t delete it, i don’t see that code anywhere

Anyways this is the exact code that roblox gives so it must work

You disconnect the function before even trying to call the followPath() function. That’s probably why.

I fixed it and nothing changed

Same thing happens here. You disconnect the function before even setting the isWalking variable to false.

reachedConnection:Disconnect()
blockedConnection:Disconnect()
isWalking = false

That didn’t fix it either, it seems that the character does turn and try to move but can’t move at all

Almost as if it’s too heavy but I turned on massless

Do you ever move the character, it only looks like you’re calculating the path only.

Also it looks like you forcefully set the waypoint to 2, then move the character.

It’s probably constantly trying to walk to the second waypoint.

That only runs once and it’s because the first waypoint is the starting point, this is just Roblox’s code I didn’t modify it.

Try calling :SetNetworkOwner(nil) on the NPC’s HumanoidRootPart.

I wouldn’t think it’s the client’s fault, so setting the network owner might do nothing.