MoveTo function not working at all

  1. What do you want to achieve? Keep it simple and clear!
    When the user touches a part, the NPC is cloned, duplicated to the workspce, and is supposed to move the NODE1

  2. What is the issue? Include screenshots / videos if possible!
    The NPC DOESN’T move at all and no errors appear

  3. What solutions have you tried so far?
    I’ve tried NODE1.Position and just NODE1

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

local part = script.Parent
local replicatedStorage = game:GetService("ReplicatedStorage")
local debouce = false



part.Touched:Connect(function(hit)
	if debouce == false then
		if hit.Parent:FindFirstChild("Humanoid") then

			local npc = replicatedStorage:WaitForChild("NPC"):Clone()
			npc.Parent = game.Workspace
			local humanoid = npc:FindFirstChild("Humanoid")
			humanoid:MoveTo(game.Workspace.NODE1.Position)
			humanoid.MoveToFinished:Connect(function(hasReached)
				print(hasReached)
			end)
			debouce = true
		end
	end
	
	
	
end)

Something to note is that if I use prints to print the touched part’s name and stuff the prints work so its not a script position statement in the hierarchy

1 Like

are you sure that the npc itself is not anchored or anything? I tested it with my own rig and it seems to work.

1 Like

Would the Anchoring of the HumanoidRootPart and/or Humanoid parts contribute to the problem? They’re both Anchored.

Try unanchoring all the parts that are anchored in the character so that the character can move, they should be the problem as anchoring the NPC will make it unable to move.

1 Like

Ya unacnhroing the HumanoidRootPart fixed it :slight_smile:

1 Like

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