Humanoid:MoveTo() Not Working

I am trying to create a cutscene from the client where a model of a character walks from one point to the next. I am running into an issue where the :MoveTo() function will not work.
Here is a copy of the script in PlayerScripts:

local humanoid = workspace.Cutscenes["1"].UncleKyleModel.Humanoid

while task.wait(1) do
	print("works")
	humanoid:MoveTo(workspace.TestPart.Position)

	humanoid.MoveToFinished:Connect(function(reached)
		if reached then
			print("Humanoid reached the target")
		else
			print("Humanoid did not reach the target")
		end
	end)
end

The script prints “works” and nothing else. The HumanoidRootPart is unanchored and I have tried running this script from the server as well. I can’t figure out how to get this to work as Humanoid:MoveTo() works fine later in the larger script I am implementing this in and from the server to control an enemy AI. Any ideas? Thanks.

1 Like

Is the Humanoid’s WalkSpeed set to 0?

From what I understood, this might be to do with the fact you’re running this code on the client and the NPC model is owned on the server.

Depending on whether you want other players to see the same NPC in the same custscene at the same time, you could either:

  1. Try moving this code onto a server script so that the server-owned character model will move for all clients
  2. Clone this character model on the client so that each client is seeing a unique version of the cutscene/character model, and then if you move the humanoid of this new character, it should work too

if the model is in workspace it is automatically replicated to the player’s client (obvs depends on the Content Streaming Settings)

yeah a server-owned model will replicate to all clients but i doubt a client’s LocalScript could call MoveTo on that Humanoid, the server still “owns” it :sweat_smile:

That’s the difference between this and the other Humanoid:MoveTo() that worked, I’ll try this thanks. Update: It worked, thanks you!

1 Like

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