As the title states, is Pathfinding really the way to go when trying to get an NPC to follow moving targets? I find that whenever I implement Pathfinding, the Pathfinding NPC always lags behind no matter what since it has to wait for the next waypoint position. Should I just use a method similar to the one on this post instead?
I think a hybrid system between pathfinding and direct movement is best.
If a raycast from the NPC to the target doesn’t yield the target then use pathfinding, otherwise always directly walk to the target.
5 Likes
I’m not opposed to trying this out, but could you provide an example/reference for raycasting? I tried to search it on the wiki, and I noticed that the article is missing.
The raycasting article is for guns, Raycasting: Making a ray casting laser gun in Roblox. References for raycasting are available under the Workspace, where all the raycasting APIs are held.
2 Likes