How to make a pathfinder/line robot?

Hi, I am trying to make a game where a part will travel on a bezier/curved path and I don’t know how to do that. I don’t want to use parts that tell the Robot where to go. Is there a way to detect curved paths and follow them? E.g

1 Like

you can use pathfinding modifiers. The only problem is that they dont work outside of studio since their in beta. So if you dont want to wait for that to happen you can do a custom path by manually placing waypoint parts. heres an example file.
Custom path test.rbxl (64.9 KB)
feel free to use the stuff in ur games. If you have any questions then feel free to ask

Yeah, I know that I can use waypoints. I was just trying to not use them since having different maps and placing waypoints is really time consuming. I tried searching the forum but couldn’t find anything.

You COULD use pathfinding modifiers. Just beware that they DONT work outside of STUDIO! I’ll give you a brief tutorial on how to use them. First, go to file → beta features. After that, go to pathfinding modifers and tick the check mark


After that, restart studio. Once you’re back in studio, you’re going to need to add a pathfinding modifer object to the baseplate
image

once you did change the modiferid to “Plate”, make sure paththrough is set to FALSE. Also keep in mind, multiple parts can have the same modifier Id
image
next the script. Make sure to edit it to work for your situation

local PFS = game:GetService("PathfindingService")
local Humanoid = script.Parent.Humanoid
local HRP = script.Parent.HumanoidRootPart
local EndPoint = workspace.EndPoint
local Params = {
	Costs = { -- this is where it gets fun!!!
	Plate = math.huge -- the cost of the object. The higher it is the more the NPC will try to avoid it. Make sure that this is the ModiferId you put in your pathfinding modifer
	}
}
local Path = PFS:CreatePath(Params)
Path:ComputeAsync(HRP.Position, EndPoint.Position)
if Path.Status == Enum.PathStatus.Success then
	local Waypoints = Path:GetWaypoints()
	for i,v in pairs(Waypoints) do
		Humanoid:MoveTo(v.Position)
		Humanoid.MoveToFinished:Wait()
	end
end

here are the results:
With Pathfinding modifiers

without pathfinding modifiers:

I’d recommend that you use the other method for now until the modifiers are out of beta since these wont work outside of studio. If you dont want to do it, then look at this place file. Use the scripts and stuff in your game. If you have a question then feel free to ask,

pathfinding modifer test.rbxl (45.6 KB)

Thanks, I might try these out after they are out of beta, but knowing that Roblox beta features are very slow to get fully patched, I might just use this in roblox studio to test for now.

(pretty offtopic but I think you should receive solution for this one, lots of dedication went into that lol)

1 Like

I agree. We need to start a revolution.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.