MoveTo() does't work

When I do PivotTo Or MoveTo on my npc it won’t move for some reason please help

all the parts of the npc are unanchored exept for the humanoid and when you bumb into the npc it also won’t move:

local enemies = game.ReplicatedStorage.Enemies
local enmiesWorkspace = workspace.Enemies
local wayPoints = workspace.WayPoints

local function spawnEnemy()
	local newEnemy = enemies.OrangeEnemy:Clone()
	newEnemy:PivotTo(wayPoints.StartPoint.CFrame)
	newEnemy.Parent = enmiesWorkspace
	
	for count = 1,3,1 do
		print(count)
		for i,v in pairs(wayPoints:GetChildren()) do
			if v.Name == tostring(count) then
				print("E")
				newEnemy.Humanoid:MoveTo(v.Position)
				print("Z")
				newEnemy.Humanoid.MoveToFinished:Wait()
				print("R") -- R doesn't print
			end
		end
	end
end

while true do
	task.wait(3)
	spawnEnemy()
	task.wait(15) -- only for testing
end
1 Like

Can you try newEnemy.CFrame:PivotTo(wayPoints.StartPoint.CFrame)?

it’s a model that’s why I’m using pivotTo

I think I know why.

Instead of using CFrame, use GetPivot()

newEnemy:PivotTo(wayPoints.StartPoint:GetPivot())

Try it like that!

1 Like

Is the HumanoidRootPart anchored?

no it’s not______________________

1 Like

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