So... I have an issue.
local monster = script.Parent
local humanoid = monster.Humanoid
local pathfinding = game:GetService("PathfindingService")
monster.HumanoidRootPart:SetNetworkOwner(nil) -- sets network owner to defult cuz it cant decide like a poor depressed 14 year old (server)
-- GET PATH --
local function GetPath(GotoPart)
local parmas = {
["AgentHeight"]=20,
['AgentRadius']=4.5,
['AgentCanJump']=false,
}
local localPath = pathfinding:CreatePath(parmas)
localPath:ComputeAsync(monster.HumanoidRootPart.Position, GotoPart.Position)
return localPath
end
-- DO THE PATH WITH GetPath() --
local function DoPath(GotoPart)
local path = GetPath(GotoPart)
for index, waypoint in pairs(path:GetWaypoints()) do
humanoid:MoveTo(waypoint.Position)
humanoid.MoveToFinished:Wait()
end
end
-- While true loop --
while true do
DoPath(workspace:WaitForChild("1"))
DoPath(workspace:WaitForChild("2."))
end
This is a script inside a character I did that but when I play it, it works, it goes between 2 checkpoints, BUT when I add a wall to separate them, guess what, the monster finishes his job (goes to a checkpoint) and just stays there like he has no idea what to do. He did go around the wall but when he goes to the checkpoint he needs to go, he stops there.
Help!?
