Using pathfinding service with flying NPCs?

Is it possible to use the pathfinding service for flying NPCs? I have a complete pathfinding solution for NPCs that travel on the ground, but I haven’t tried it with flying NPCs. Currently, flying NPCs use a vector force to counteract gravity like so:

VectorForce.Force = Vector3.new(0, npc.root.AssemblyMass * game.Workspace.Gravity, 0)

I can use Humanoid:MoveTo() but there won’t be any obstacle avoidance. However, would it even matter since the NPC is flying a set amount off the ground?

1 Like

Tricky…, id say make a fake “floor/baseplate” that stretches thousands of studs wide, and set it to the height in which the npc will fly at (i assume you can adjust this aswell), then make only the NPC collide able with that floor. Hope this helps

2 Likes

Not sure of the logistics of your game but perhaps calculate the necessary waypoints of the path using a ground NPC, and then use a for loop to iterate through the waypoints, changing their y position to itself, but higher up. Hopefully you can then use those waypoints to navigate your flying NPCS with no trouble.