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.
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:
Try moving this code onto a server script so that the server-owned character model will move for all clients
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
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