Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why doesn't Pathfinding work in water?

Asked by 6 years ago

Hi guys, does anyone know how to make pathfinding work in water terrain? (While npc is swimming or disabled swimming, either is fine). My Getwaypoints() seems to return an empty talbe when Target is in water, or when the NPC itself is in the water. Thanks!

0
I'm guessing the pathfinding service considers water as an obstacle. The empty table probably indicates that no path was found when you called the pathfinding service. Can you confirm this with path.Status? Nonaz_jr 439 — 6y
0
However if you look at the navigation mesh as described in the link below, you see that the water shouldn't be the reason for your path failing. I don't know what the reason is, sorry! https://wiki.roblox.com/index.php?title=API:Class/PathfindingService Nonaz_jr 439 — 6y
0
Actually i just discovered that it can still pathfind my character in water, but once the npc itself goes into the water, it can't move and sank to the bottom, then it reflects nil. Is it possible that my NPC can't swim hence resulting "nil"? If so are there any conditions i need to fulfill to make it swim? That's a self made NPC and it has alot of parts missing. (its a simple slime with 3 parts) lesliesoon 86 — 6y
0
After disabling swim, my NPC was able to follow me in water, but once i left the water, it can't find the path anymore :/ lesliesoon 86 — 6y
View all comments (2 more)
0
Question. What happens if your start- or end-point is to far (high) from the ground.? Nonaz_jr 439 — 6y
0
If the starting point is too high and the NPC is free falling, nil will be reflected. If the starting point is too low plus there's no viable path to navigate up, nil will be reflected. Just like how it's supposed to work. Both scenario won't be nil if there's a viable way towards the end. lesliesoon 86 — 6y

Answer this question