EZ Pathfinding Pro

EZ Pathfinding Pro

Download: EZ Pathfinding Pro - Roblox
GitHub Repository: GitHub - Targetry/EZ-Pathfinding-Pro at 1.0

About this Module

EZ Pathfinding was created to enchance PathfindingService and to make it easier to use. This module adds benefits to the existing service plus incorporates OOP. This allows you to work with Pathfinding without disturbing your workflow. It is a newer version of the EZ Pathfinding series. It sadly will be the last EZ Pathfinding module however updates will be frequently made. Making pull requests can be done on the GitHub repository. Extensions are allowed however they must be approved by me before being released to the public. This module is under the MIT License.

Setup

  1. Download the model via the link at the top of this topic.
  2. Once downloaded, insert it into your game by going to the toolbox and selecting “Your Models”.
  3. Read through the GitHub repository for examples, documentation, and more details about this Pathfinding module-script.
  4. Using the collected information, insert a script into the npc that will be moving along the path and type in the necessary info needed to create a path and put the npc in motion. If you are having trouble creating a workable script, contact me or use the example I provided in the repository.

Documentation

module.new (npc, end, vector, array, power, PathSettings)

Using the function module.new will create a new path using the provided parameters.

The “npc” parameter should be the path to the rig model or part that is moving along the path. Example: workspace.Rig

The “end” parameter should be the path the goal/end of the path (this is where the npc will be directed to). Example: workspace.End

The “vector” parameter is optional if you put in the path to the goal with the “end” parameter. Setting this param requires a Vector3 int. The npc will be directed to the desired location using the vectors. Example: Vector3.new(6, 0, 6)

The “array” parameter only needs to be filled in if you are looking to use the ArrayMovement function. This parameter should contain an array with the various parts that the npc needs to travel along. Example: {[1] = workspace.Part1, [2] = workspace.Part2, [3] = workspace.Part3}

The “power” parameter is for use for the jump function. If you are not going to use the jump function, don’t fill this in. This should be a int (number). Depending on the power, jumping may vary in height.

The “PathSettings” parameter is for customizing path/npc behaviours. It is used for the “SetSettings” function. The array does not need to contain everything, only the things you want to change. Example: {[“Tweening Info”] = TweenInfo.new(0.5, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0), [“AgentParameters”] = 10, 5, true, [“Movement”] = {[“WalkSpeed”] = 16, [“JumpPower”] = 50}}

path.Move

This function will set the npc in motion along the path. In order for it to work, you need to have successfully created a path prior to calling this function.

path.ArrayMovement

This function requires the array parameter to be filled in with correct details/paths. The npc will move along the path provided. It will reach each part in the array before heading towards the end.

path.Pause

Calling this will pause the currently running path. Can be resumed with the path.Resume function.

path.Resume

Calling this function will resume a paused path. If the path is not paused, this function will do nothing.

path.Stop

Calling this will completely stop the path. It will not run nor will it be able to be resumed.

path.Jump

Depending on the “power” parameter, the npc will jump upwards (or in a jumping motion if the npc is a part) at a faster/slower rate. The power also determines the height of the jump.

path.SetSettings

Using the provided array, it will change values to your liking, allowing for easier use of the module. Calling this requires the “PathSettings” parameter to be filled in with an array containing the desired modifications.

path.CalculateTime

Calling this will return an int of the estimated time it will take the npc to reach the goal.

Thank for taking the time to read through my topic. Be sure to contact me for help or submit a pull request if you find an issue! Please vote on the poll so I have a better understanding of how people are liking this so far.

  • I love this module; wouldn’t change anything.
  • I have some feedback (contact me)
  • I have lots of feedback (contact me)

0 voters

Have a wonderful day!

16 Likes

I’m having a hard time keeping track of what pathfinding module of yours to use.

3 Likes

Haha. I recommend that you use this one since it is much easier to handle and is less costly performance wise. This will be the last module so you won’t need to switch any more :sweat_smile:.

does this pathfinding module support an ignore list?

No it does not. It is easy to add extensions so if you would like to add that as an extension (if you have the knowledge), that’d be cool. If not, I can add it to my list and it would be worked on.

I don’t see how? At least give some appreciation for community shared resources. In fact, every EZ Pathfinding module has it’s purpose. It makes using Pathfinding service easier to use plus adds bonus functions. If you choose not to use it, you don’t have to. Flat out saying a resource is plain trash is just rude. I shared this with others when I could’ve kept it for myself. Please read through my topic and GitHub before trash-talking this module.

1 Like

Hi, I was wondering how optimized this pathfinding module is. For example I want to add like around 20 NPC’s in a town using pathfinding.

If you’re using multiple NPC’s for a game, you should use CollectionService to loop through them. Then, you can add all your pathfinding code in the loop.

This approach is more performant than using individual scripts per character model.

This is really cool! Only problem is, it doesn’t work :confused:

https://gyazo.com/581a56c550ec6b5124a80ca7015c9589

local WorkSpace = game:GetService("Workspace") 
local module = require(WorkSpace:FindFirstChild("MainModule"))

local path = module.new(script.Parent, WorkSpace.Part)

path.Move()

what am I doing wrong? I’ve tried PrimaryPart and script.parent.parent and those don’t work either :frowning:

1 Like

Make sure to un-anchor all parts of the character. I am going to rework the whole module soon because it is now pretty outdated.

Everything is unanchored already, do you have an example place file that works?

1 Like

Hi! I’ve been having the same issue that @wowland856 also had, until I decided t look through the code and I found this:
image

After removing these lines, your code seems to work as intended. Was there a reason for you to add these extra lines? I mean, the

local hum
if hum then
    hum = hum
end

? Because you are setting the existing hum, also the existing humanoid value, to nil.
And right under those lines:
image
And since you set hum to nil, it never triggers to make humanoid actually move.
I hope this will help other people in the future as well, now I’ll be on my way to play around with your module, to anyone reading this, have a nice day! :smile:

Hello! My pathfinding module series has been discontinued for a while now. The latest version of it is EZ Pathfinding V5 which has a lot better code than the one you are using. I believe that SimplePath is another alternative but I have no idea if that is still being maintained.

1 Like

Ah ok, thanks for the information and update!
I’ll gladly check out your V5 in that case :smile:. Also thanks for giving me an alternative to check out. I wish you a nice day!