Hello I’m brand new to this project. Sadly needed for a GameJam @_@
My problem is I’m using the standard 2D setup (My Game is a side scrolling platformer)
However when using the AIPath script, the objects rotate whole(x,y,z) and go inversed, even rotateIn2D on.
I was trying to get the rotation to work exclusively in the y axis but my attempts fail, with the object going elsewhere (normally up)
I apologize for this noob question that’s probably gonna bug some people @u@
How can I constraint the rotation to y axis without hindering the move direction?
None of the included movement scripts are intended for side scrolling platformer games unfortunately. You can get platformer pathfinding to work using usually a point graph, but it is not a use case that this package is built for.
I think you will want to use some other kind of pathfinding library for this. Here is one other library for example: https://www.assetstore.unity3d.com/en/#!/content/37332.
Thanks @_@ I’ve gotten to do some workarounds and even fixed this issue, however now I keep getting errors when calculating paths. I switched the target from a transform to a vector3 for randomization btw
Path Failed : Computation Time 0.00 ms Searched Nodes 0
Path Number 1 (unique id)
AstarPath:LogPathResults(Path) (at Assets/Plugins/AstarPathfindingProject/Core/AstarPath.cs:763)
AstarPath:<InitializePathProcessor>m__2(Path) (at Assets/Plugins/AstarPathfindingProject/Core/AstarPath.cs:1153)
Pathfinding.PathProcessor:CalculatePathsThreaded(PathThreadInfo) (at Assets/Plugins/AstarPathfindingProject/Core/Misc/PathProcessor.cs:374)
Pathfinding.<PathProcessor>c__AnonStorey1:<>m__0() (at Assets/Plugins/AstarPathfindingProject/Core/Misc/PathProcessor.cs:95)
Edit 2 : It turns out it’s a thread thing?
Huh. It seems you have found a bug. Not really related to anything you want to do though, it’s just that the ‘Error:’ message is empty which it should never be. I have fixed this in my dev version now and it will be included in the next update.
In the log you should see another warning message with the error that the path failed with.
I suspect it will say something like “Couldn’t find a close node to the end point” which means that you are trying to request a path to a point far away from any point that the character can reach.
Actually, there isn’t any. Is there by any chance a place where we could get in-dev packages? Like a git?
It will show up as a warning, and you have those disabled in the console.
Beta releases are posted on this page: https://www.arongranberg.com/astar/download however currently there is no beta release.