I just purchased the upgrade to 4.0 with the goal of getting AIPath to work with 2D. I got it to work (sort of), but have a question and a plea:
The question: do we need to rotate the grid to -90,0,0 or 90,0,0 for XY movement? From reading the code, it seems like -90,0,0 is correct, however in the 2D RVO example scene it is set to 90,0,0.
The plea: is there ANY way to implement AIPath in 2D without having to use transform.forward? Unless I’m doing it wrong, the only way an agent will currently move is if it’s flipped -90,0,0 (otherwise transform.forward will be converted to 0,0 by the system and the AI won’t move). But for our project flipping the AI like this causes all sorts of problems with collisions and other code which assumes the AI is only going to be rotating on the z axis.
I paid for the upgrade explicitly to get the new 2D features and this is really a crushing blow.
Once I made those two changes, AIPath seems to work fine in XY space without any need to rotate objects. I’ll be honest and say I don’t fully know why those changes work, so please chime in if you know, or if these changes are a bad idea.
Ah. It seems I have configured the 2D example scene incorrectly. It should be (-90,0,0). Both -90 or +90 will work however the ‘up’ direction of the graph (the plane normal) will be either along the -Z axis or the +Z axis depending on which one you choose. Usually you want the -Z axis.
I thought about that but I figured that one can easily create a rotated child object on which you can place the sprite or collider or anything else which requires a particular axis to be the forward direction. I try hard not to add too many options to my scripts, however in this case maybe this trade-off wasn’t the best choice? The alternative would be to add a new field
public int forwardAxis = 2; // 0 = x, 1 = y, 2 = z
Thanks Aron, having the option to determine the forward/rotation vector would definitely be a big help. In my first reply you can see the two overrides I made to get AIPath to work on the XY without rotation objects :-).
Asset Store updates take weeks I’m afraid. It has to go through a review process by the asset store staff. You can download the latest version from the package website.
Sorry for taking a while to respond, but I was able to download the new version and by checking off the Rotate in 2D option I was able to delete my two overrides and get the same results w/out any issues. I’ll let you know if anything else comes up, but it’s greatly appreciated!