Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Methods of using the pathfinding service for arial pathfinding?

So far the only method I can think of is creating a path and then shooting rays above and below it to find its ceiling and floor heights, but this may prove fairly expensive. Are there any alternative methods to utilizing the Y axis more with pathfinding?

2 comments

0

additional thought is creating a nodegraph and translating that into a 4x4 map.

0

Attempted the above, however the logistics of this don't seem to add up.

1 answer

If anyone is still interested in this, I've opted to utilize a few things; When the player, or point of interest was last "seen", casting a ray and then if that position is no longer visible to the NPC, moving the NPC to that position, Lerping the height, I cast two rays to find the roof and floor, creating the maximum a Y position can be at, and the minimum. I then apply this information to create the Y height for a BodyPosition that can only dictate the Y position. Humanoid:MoveTo. Is incredibly useful. I owe it my firstborn.

Instead of constantly trying to move the NPC's Y height to the point of interest's height, I instead take the WalkToPoint. This compromize does lead to some annoyances. For example, when two points are slightly above one another and a corner hinders the NPC's path. The bodyposition's Y will change to reach it, however the friction between the NPC torso and the corner can cease its movement near indefinatley.

This discussion is preserved as it was. New answers, comments, and votes are closed.