Build Grid on sky(without any Gameobject)

  • A* version: [5.3.7]
  • Unity version: [2022.3.43f1c1]
    Hello, I am developing a 3D game project related to ground to ground missiles. In my plan, the missile will first take off vertically and reach high altitude, and then land from high altitude to strike ground targets. I want to use AStar in the air to perform operations such as avoiding air defense zones. I would like to know if the latest Astar Project can generate something similar to grid in the air for path planning? I tried using Layer Grid and built several layers of Grid Graph, but I’m not sure if it works. If it doesn’t work, do I have any good solutions? Thank you for your answer!

    I upload my game photo which dont use your package

The last image is the layer grid that I am currently trying



I don’t exactly understand what you want to use pathfinding for. Is it to plan a general route to the target, or to do mid air movements to avoid things trying to shoot it down?

If your just doing flight path, you could use a single graph on a plane and then have “air defense zones” cut a large area out of the graph so your missiles go around them. You would have to do the vertical movement and rotation of the actual missile separately.

For mid air dodging I would use raycasting to detect incoming bullets and move/turn away from them.

Thank you for your reply. I would like to plan a path to the target while avoiding the air defense zone set up in the sky (which is a spherical area that may move).What type of grid should I use?

I think you’re going to want to look into a point graph. You’ll be able to map out the air space as you want it in full 3D space.

2 Likes

thanks! after a small try, I create a small point net!

Glad to help :slight_smile: Word of caution, you may want to try being more dynamic with the density of your points to keep performance up. If it’s not an issue for you so far that’s great but if it becomes one you may benefit from (depending on your games needs) updating your graphs when needed to be denser/sparser where required.

Check this page for more information on making changes to your graph during runtime

Thank you again, after a small scale attempt, I did get the point graph to cover the entire sky, but it did have some performance issues, which I then used the Optimize for sparse option and it was alleviated, I will learn from your link

1 Like

If you need any help implementing the stuff in the link let us know :slight_smile: