简体   繁体   中英

Gridless Pathfinding - Unity3D

I was wondering what best approach to take when trying to implement pathfinding but without using a grid.

In this example, the player is a able to place road tiles on a grid, but I only want to pathfind the placed roads (no need to compute for the whole map).

I've tried a couple things but with no luck.

Any help would be appreciated.

Thanks in advance.

I think you are looking for A* algorithm. There are also other ways to do this, but most of them are based on graphs, including Unity NavMesh .

There is amazing site with interactive examples and implementation guide, for sure it will be helpful, whether you want to implement this yourself or just understand how it works: https://www.redblobgames.com/pathfinding/a-star/introduction.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM