Hmm, if my random goal position is near a wall then my npc tries to go to it and is too big to reach it despite setting a high agentRadius, but doesn’t stop trying till it errors in a few secs. What to do what to do… Can I deal with this using the module or will i need to implement my own pathfinding entirely?
Also the Discord Server link just takes me to this page again
Alright I’m here to report a bug I’ve been having for a while;
Without rhyme or reason, the AI will sometimes move back and forth between the previous and current waypoints. I’ve tried to replicate this issue but to no avail. Perhaps you could take a look into the module and investigate? Thanks.
--Import the module so you can start using it
local ServerStorage = game:GetService("ServerStorage")
local SimplePath = require(ServerStorage.SimplePath)
--Define npc
local Dummy = workspace.Dummy
-- Define a part called "Goal"
local Goal = workspace.Target
--Create a new Path using the Dummy
local Path = SimplePath.new(Dummy)
--Helps to visualize the path
Path.Visualize = true
while true do
Path:Run(Goal)
end
What I did was every time the path:Run() is called, it’d check the new waypoints for the closest waypoint to the agent. It’d then return the number ID of that waypoint, and set that as the starting point. Not the greatest or most efficient solution but it works for now.
Do you have a Dummy and a Target in Workspace? Where do you have put the module? If it’s in ReplicatedStorage you need to change “ServerStorage” to “ReplicatedStorage”. If you haven’t done these things, then it’s no wonder it doesn’t work.
The module is not working at the moment, I copied the example code and the latest module from Github into a module in replicatedstorage, with a part in the workspace called Dummy and when I run nothing happens and no errors.
local SimplePath = require(game.ReplicatedStorage.SimplePath)
--Define npc
local Dummy = workspace.Dummy
-- Define a part called "Goal"
local Goal = workspace.Goal
--Create a new Path using the Dummy
local Path = SimplePath.new(Dummy)
--Helps to visualize the path
Path.Visualize = true
--Compute a new path every time the Dummy reaches the goal part
Path.Reached:Connect(function()
Path:Run(Goal)
end)
--Dummy knows to compute path again if something blocks the path
Path.Blocked:Connect(function()
Path:Run(Goal)
end)
--If the position of Goal changes at the next waypoint, compute path again
Path.WaypointReached:Connect(function()
Path:Run(Goal)
end)
--Dummmy knows to compute path again if an error occurs
Path.Error:Connect(function(errorType)
Path:Run(Goal)
end)
Path:Run(Goal)
This is my primary issue, the module makes NPC’s jump between nodes when stuck, sadly it’s making it jump to the defective node and the next in the queue repetitively which gives it a “wall hugging effect”.
At this point, I messaged the creator twice and yet no response on a resolution which led me to believe it isn’t maintained anymore.