GridGraph remains invisible on existing AstarPath object

I’ve checked other topics on this issue. Somehow, when entering play mode, the AstarPath’s grid graph on a GameObject remains invisible. Adding new GridGraphs to the object doesn’t change anything; they also remain invisible.

However (during play mode) disabling the current AstarPath, creating a new GameObject and attaching a fresh AstarPath component to it - and creating a new Grid Graph with that - does work. The newly created GridGraph is visible again in the Scene view - but this is of course only during Play Mode.

I’ve re-imported the package but that did not change anything. The Grid Graph’s visibility settings are turned on. There’s nothing turned off (during Play Mode) in the Scene view either (as shown with the example above, that cannot be the case). I’m mystified what else it could be. Toggling the Show surface and Show outline buttons on the invisible graph doesn’t affect anything.

  • A* version: 5.4.5 (Pro)
  • Unity version: 6000.0.62f1

Cheers.

I did some more testing; the object with the AstarPath component is in a scene that gets loaded in. But when I place an AstarPath component on a DontDestroyOnLoad object in the first scene, that one’s graph(s) remain visible. However, I need my AstarPath object in the loaded scene.

EDIT: Upgraded the project to version 6000.2.6f2 but the problem persists.

Is this new GameObject scanning within it’s subscene? As a note, Astar cannot scan into subscenes from outside of them. If this is your setup and you’re not using a procedurally generated world, you’ll want to scan your worlds in Edit Mode, cache the graphs and load them. Here’s a link to the documentation about this:

Explain your usecase for me a bit and I can provide some information on what may help :+1:

Hi teal, thanks for replying!

I wouldn’t know how to use Astar in the way you describe it, either. It’s simple: There is a Boot scene which - via a Menu scene - loads the World scene, asyncronously.

A similar setup worked fine in a previous project. In fact; I replicated that setup in my new one and it worked exactly once, where the graph was visible in the Scene view.

Since then I tested some more different setups with all the same negative result. Then, I reverted back to the one setup that did work, and now that also in that setup the gridGraph remains invisible in the Scene view during Play Mode.

Weird.

So regardless of how or where I place AstarPath in my loaded-in scene, it remains invisible in the editor’s Scene view during Play Mode. But it was visible once, right after I booted the editor and changed it to this setup. Very strange.

The graph, AIs and AstarPath work as intended; but the graph is just invisible in the Scene view during Play Mode. I can spawn agents and they path as expected. Their gizmos are drawn just fine. When updating (for instance when I add an obstacle in the game) the graph Scans just fine for obstacles and sets cells accordingly - however, I cannot see this happening in the graph during Play Mode - which is frustrating.

I can only guess this is a bug in the Editor or with however A* draws its gizmos? There are no errors or warnings. I doubt this is intended behavior on anyone’s part.

Edit: Important distinction I just noticed that previous project I mentioned was version 5.4.4. Maybe it’s a bug in 5.4.5?

Yup, it seems to be a 5.4.5 problem. I just replaced my 5.4.5 package in my project with a 5.4.4 version and hey presto! The gridGraph is visible in the Scene view again during Play Mode.

Changing how I organize that scene doesn’t affect it, it remains working. I can finally continue with my project.

:beetle: Bug found?

Nice find! I’ll tag Aron on this to review. Thanks for all the detailed information <3

1 Like

Great find!

Thanks! I found the issue.

I’ll include the fix in the next update.

1 Like

Great to hear! You’re most welcome Aron; A* is a fantastic plugin. Keep up the great work!

1 Like