- Home /
How to indicate/display path-finding result in minimap ?
When player gives a destination location, in minimap the shortest path should display (like navigation system).
You need to integrate a pathfinding solution for this, such as the Astar Pathfinding Project.
You have to convert each node's world position to the corresponding position on the $$anonymous$$imap, and then draw lines between them with the custom UI LineRenderer or whatever you want to use for this.
Thank you for your reply. But i don't understand how to do it. I'm new to unity and game program$$anonymous$$g.
In my game I've got a city and a player with basic movement also a $$anonymous$$imap.
i used this method to add the $$anonymous$$map https://www.youtube.com/watch?v=3-CN2DXqJj$$anonymous$$
now i need to indicate the shortest path from the current position of the player on this $$anonymous$$imap, once user gives the destination point.
Can you explain me the steps ?
Forget about hte $$anonymous$$imap fo now, first you have to integrate a pathfinding solution. Find one that suits your needs and once you figure out how to make your character move via pathfinding, you can focus on the $$anonymous$$imap display.
I agree with @Cherno .
here is the top link from google for A* pathfinding in C#:
http://blog.two-cats.com/2014/06/a-star-example/
this is pry the most simple and popular algorithim for pathfinding.
more than likely you will use an array of arrays to represent a two dimentional grid pattern to calculate your path. one you trace back the path coordinates from the A* algorithim, it would be super simple to paint that pattern on top of a texture for display. but honestly, if you get through the A* pathfinding algorithm and manage to wrap your brain around that. you wouldn't be asking about how to paint a $$anonymous$$i map.
both pathfinding scripts and how to paint a $$anonymous$$i map or texture require very good understanding of loops and arrays and how to apply it to 3d or 2d space. paging through 2d is accomplished with a loop inside of a loop and an array of arrays to accommodate two coordinates.
Your answer
![](https://koobas.hobune.stream/wayback/20220612124856im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Pathfinding & Navigation in 3-dimensional space (proced. generated) 2 Answers
How do I fix two NavMeshAgents fighting for the same position? 1 Answer
Do your NavMeshAgents choose different paths in the editor? 0 Answers
How do you create an AI that works like this ? 1 Answer
How to use Unity's pathfinding system without NavMeshAgent controlling my character? 1 Answer