i am trying to teleport a custom humanoid in my game yet everytime i try to teleport the thing :moveto() stops working (as in the humanoid just doesn’t move) (my code does work ive tested it without teleporting)
i don’t work with humanoids much so this issue is very new to me
humanoid looks like this
--I HAVE TO USE LUA FOR INDENTS.....
model (primarypart is humanoidrootpart)
-humanoid
-humanoidrootpart
-motor6d connected to torso
-torso
-motor6d connected to head
-head
my code for creating and teleporting the humanoid
local meat = meatPrefab:Clone()
local meatHumanoidRootPart = meat.HumanoidRootPart
local meatHumanoid = meat.Humanoid
meat.HumanoidRootPart.CFrame = workspace.SpawnLocation.CFrame + Vector3.new(0, 10, 0)
meat.Parent = workspace.meats
for _, meatPart: BasePart in meat:GetChildren() do
if not meatPart:IsA("BasePart") then continue end
meatPart:SetNetworkOwner(player)
end
meats[player] = meat
meatCount += 1
my movement code:
if random:NextInteger(1, 100) == 100 then
local randomMovePosition = Vector3.new(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50))
path:ComputeAsync(meatHumanoidRootPart.Position, randomMovePosition)
for _, waypoint: PathWaypoint in path:GetWaypoints() do
meatHumanoid:MoveTo(waypoint.Position)
if waypoint.Action == Enum.PathWaypointAction.Jump then
meatHumanoid:ChangeState(Enum.HumanoidStateType.Jumping)
end
meatHumanoid.MoveToFinished:Wait()
end
end
directly setting movetopoint in properties makes it work but it doesn’t work in the script so i have no idea whats happening