Trying to use Humanoid:MoveTo for a custom model, but it isn’t working. I think I may have set it up wrong, but what could I change. All of the parts are unanchored and CanCollide is set to true.
local path = PathfindingService:CreatePath()
path:ComputeAsync(grandpaHRP.Position, hrp.Position)
for _, waypoint in path:GetWaypoints() do
grandpaHumanoid:MoveTo(waypoint.Position)
grandpaHumanoid.MoveToFinished:Wait()
end
The code doesn’t run after the MoveToFinished since the model doesn’t actually move.
local path = PathfindingService:CreatePath()
path:ComputeAsync(grandpaHRP.Position, hrp.Position)
if path.PathStatus = Enum.PathStatus.Success then
for _, waypoint in path:GetWaypoints() do
grandpaHumanoid:MoveTo(waypoint.Position)
grandpaHumanoid.MoveToFinished:Wait()
else print(“Failed to compute path”)
end
I just used this code. It’s not failing to compute the path, it’s just that the humanoid itself isn’t moving. I think something is wrong with the way the model is rigged.
Did you make this model yourself? I’ve come across free models that don’t work with MoveTo() like your case here. Then it could just be the way Grandpa’s body is built
Double check while testing (not in edit mode) to see if all the Parts are still unanchored.
Also, print your variables before using them to see if the code that sets them is working properly. If these numbers don’t match what you expect then you need to troubleshoot the other section of code: