Hi, so I’ve been using the project for a while and it’s awesome but I’ve been using it for a new project (this one is 2D) and it works great in the scenarios I’ve used it in but this scenario is a bit different.
Basically, the object the pathfinding is done on moves, which means the grid position has to move as well. I’ve written all the code that keeps it in sync just fine. but the object that moves has child objects that move within it.
This is where the problem comes in, these objects are what uses the pathfinding and since it’s children, I need to use their local space to keep relative to its parent for movement. The problem is that for example the StartPath method seems to calculate everything in world space for it, since the grid is in world space and just in the position of the parent object that I keep in sync.
Because of this there is no way I can move one of these children’s local transform positions with it since the path is in world space, if I do then they’re obviously offset. I can just make them move in world space but then it falls apart when the actual parent object is moving plus the child objects too. It’s fine if I move to different positions and then the parent movement is halted and then child object movement is done, but I need them to be able to move together.
I’ve tried converting the StartPath vectors to local space but it’s pointless since those vectors are “parents” to begin with so it can’t be done.
TL;DR: I’m just wondering, is there any way to make a grid graph be done in local space of a particular object so then when it calculates a path it would also be in local sp[ace?
I’ll give an example of my setup:
There is a ship object. This ship moves in world space. This ship has people, they are children game objects. They also have their own movement and that movement is in local space obviously. I have a grid graph setup that works just fine on an object that is also in world space, I keep its position in sync with the ship object for when it’s moving perfectly. The people objects try and calculate a path, it does calculate the path just fine, but this path is obviously in world space. Now when I try and move the child objects according to this path, it’s obviously offset because it’s using world space in its local space movement logic. The paths and stuff are perfect otherwise.
So how do I deal with this? Hopefully this wasn’t too confusing in trying to explain my dilemma.