A* Pathfinding Question — Drawing path in game

Updated on July 22, 2017 in [D] Game Dev. gossip
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
2 on July 20, 2017

Hi there,

 

In my recent game I’ve been deveoping, I am using Aron Granberg’s A* pathfinding to allow units to reach their destination. 

 

My question is, has anyone had experience (or know if its possible for that matter) to show an in-game drawing or representation of the path set from the A* component? 

For example, in the scene you’re working in, by default a green line will be shown to represent the path taken to the destination. I’m just trying to get something similar to this in the actual game view.

Thanks,

NoTNeK

  • Liked by
Reply
1 on July 20, 2017

You should take a Linerenderer, set the coordinates to world space and add all the positions in the path as the positions in the linerenderer.

 

on July 22, 2017

Thanks for the suggestion! I’ll try doing that

Show more replies
  • Liked by
Reply
Cancel