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
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
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.