by the way, i have a suggestion:
maybe you should add an option that when enabled, makes the pathfinding NPC try their best to go to a player/humanoid npc and have the humanoid be customizable, because it is kinda difficult to have it chase NPCs due to the fact that i have to manually edit the code and it only chases npcs to their last position and it’d be quite helpful if this was added
You should make this more compatible with bigger Humanoids. I tried using it on a character that is 1.5x bigger than the average player, and even after changing the AgentHeight and AgentRadius, the character would walk backwards to the starting node every time I would change its goal. But, I found a workaround.
local path
while true do
path = SimplePath.new(script.Parent, {AgentHeight = 7.5, AgentRadius = 3, AgentCanJump = true})
game:GetService("RunService").Heartbeat:Wait()
local goal = FindNearestTorso(script.Parent.Torso.Position)
if goal then
path.InitialPosition = script.Parent.Torso.Position + (goal.Position - script.Parent.Torso.Position).Unit * 2
path:Run(goal.Position, false)
end
end
Hey, thanks for the feedback! When you execute the Run() function, the module calculates the timeout of the rig using walkspeed and rig size. So say if the rig needs to jump in order to reach the next waypoint. In this case, it can be detected by the module when the rig doesn’t reach the next waypoint within the calculated time. If there’s a timeout, the rig jumps automatically. So you don’t need to worry about making the pet jump. It will jump itself.
Edit: I had to add this feature since roblox autojump doesn’t work always and is unreliable.
Oh I thought you meant if it jumps over an obstacle like an inteference blocking the path. In that case, the module doesn’t make the rig jump over gaps. It doesn’t because roblox’s pathfinding service does not support that.
The module uses Roblox’s pathfinding service which has autojump enabled by default. But sometimes, in the case where the humanoid gets stuck because of some kind of obstruction and there’s a timeout for the MoveTo function, the code makes the humanoid jump. This is an extra feature I added because the humanoids get stuck sometimes even with autojump.
@GrayzcaIe I love this module and I think it’s really helpful. I think you should add a “trail” function or something like that after the NPC moves to that spot.
This topic is an archive of the experimental/unstable release version of SimplePath. This version is deprecated and is no longer being updated. It is highly suggested that you use the latest version of SimplePath which can be found below. If you have questions/concerns regarding SimplePath, post your reply on the latest SimplePath topic.