Hello, I would like to know what’s wrong with my Pathfinding robot.
Its a Humanoid body, with the robot on the head motored on it.
It should follow you, but instead it spins huge circles or glitches behind or infront of you.
local hrp = script.Parent.HumanoidRootPart
local function Follow()
if not script.Parent.FindTarget.Aggressive.Value then
local distance = 100000
for _, player in ipairs(players:GetPlayers()) do
local Owner = script.Parent.Drone.Owner
local target = workspace[Owner.Value].PrimaryPart
if target then
local magnitude = (target.Position - hrp.Position).Magnitude
if magnitude <= distance then
distance = magnitude
nearestPosition = target.Position
while true do
I tried that. I basicly had issues with multiple pathfinding ways, no matter what i tried it would keep doing something else, like glitching, or spinning… Thank you for your help, but I don’t know what to do now, I basicly don’t even know why I asked, because I really tried EVERYTHING, well… If you don’t see any errors in this script, I don’t really know…
I’ve had this problem too, and Roblox should make pathfinding much easier. I spent all day one day figuring this out and all I came too was that humanoid.MoveToFinished:Wait() makes it move, stop, move, stop, and setting the network owner was getting closer to the solution