Moving between two grid graphs?

Is it possible at all to make an AIPath move between two GridGraphs? How can this be achieved?

Hi

It is technically possible, but I would strongly advice you to use a single grid graph if possible because there are all kinds of nasty special cases right at the border between them (and worse if you try to overlap them, then it will be really confused as to which graph to choose when pathfinding).

Gotcha. If I manually move an agent’s transform from the scope of one grid graph to another, that should work fine and is safe, right?

Yes, that would work fine.

1 Like

Hello, I am dealing with the same issue, but when I try to edit the transform I am prevented. Both by script and directly from the editor, when the scene is running I can’t move the character outside of moving the target.

That shouldn’t be the case, @Tristan. Can you tell us more about your code?

I’m making a 2D game with point and click movement, I don’t think I have anything that interacts with any of the A* scripts. I have a high node density graph which I don’t want to expand for performance reasons and a much lower node density graph. While trying to move my player GameObject (it has the Seeker, AILerp, and Simple Smooth Modifier scripts attached) to the lower node density graph by teleporting it there I found out that none of my usual methods worked. Transform.Translate moves the player but then instantly puts it back where it started, so fast it’s almost hard to tell. In the scene view, while the game is running, I can’t drag my player around like I can with other objects.

I’ve just tried a few things. If the AILerp script is active on an object then I can’t manually drag it around during runtime. I suppose I should be able to just disable that while I’m teleporting things to new graphs.

Hi

AILerp just interpolates along the path, thus if you move it it will still continue to move along the same path as before. You will have to disable it (I think that will work anyway) if you want to do something like that (or clear its path somehow).