Loopath - Pathfinder that supports loops

Hello fellow developers! Introducing Loopath! I know it sounds weird (I just smashed words loop and path together, don’t blame me I’m not best in naming things) but this pathfinding module supports loops, for example you want to use this for your chasing NPC? No problem!

Features :

So what are the features? Here they are!

Module.new()

  • Creates new Path
  • Returns Path

    Parameters :

    • Rig
    • Path Parameters (table) (optional)

Path:Run()

  • Moves Rig

    Parameters :

    • Position (Vector3)

Path:Stop()

  • Stops Rig from moving.

Path.Completed

  • Fires when Rig has been pathfinded to Vector3 from Path:Run() function.

Usage :

You can require module with id to keep it updated :

local loopath = require(8281209121)

Alternatively you could get the module here and put it in your Rig or ReplicatedStorage and require it from there.

Examples :

local loopath = require(8281209121)
local path = loopath.new(script.Parent) --or your rig
while task.wait() do
    path:Run(Vector3.new(100,0,100))
end
6 Likes

Lol Microsoft is “microcomputer” and “software” smashed together so… :man_shrugging:


I don’t understand the “loop” part about this. Could you provide a code sample that demonstrates this looping feature?

Are all of the functions void? Because there is no documentation on what value it returns.

Module.new() only returns Path, other functions are in returned Path.

By loop I mean that pathfinder doesn’t wait until NPC has completed its path, it’s constantly getting path and moving on it :

local loopath = require(8281209121)
local path = loopath.new(script.Parent) --or your rig
while task.wait() do
    path:Run(Vector3.new(100,0,100))
end

Good day,

I am trying to get working but getting the error below running on a simple part in the workspace

    Workspace.Part.MovePartTest:11: attempt to index nil with 'Run' 

– Code Start
wait(5)
local loopath = require(game.ReplicatedStorage.Modules.PathFinder)
local x = script.Parent.Position.X
local y = script.Parent.Position.Y
local z = script.Parent.Position.Z

local path = loopath.new(script.Parent)
while task.wait() do
path:Run(Vector3.new(x, y, z + 20))
end
– Code End

Hello, are you sure that in loopath.new that you have your Rig in first argument?

Updates v1.1 :

  • Fixed Rig sometimes doesn’t move
  • Added jump support

How to keep being up-to-date?

I recommend you to require id of the module so when update comes out you can be up-to-date.

Updates v1.1a :

  • Added debug mode (available when using source, to activate open the MainModule or what you named your Loopath module and change debugMode variable from false to true)

How to keep being up-to-date?

I recommend you to require id of the module so when update comes out you can be up-to-date.

Function Run can only be used in Path so like :

local loopath = require(8281209121)
local path = loopath.new(script.Parent) --or your rig
while task.wait() do
    path:Run(Vector3.new(100,0,100))
end