A* Pathfinding on moving object

Recently i started work on my project where AI will have to navigate on moving islands. I was searching a lot how to accomplish that and found solution on this site (i was told that i have to transform into non-moving scenerio). I had to use methods like InverseTransformPoint() or TransformPoint(). I tried to implement them into AIPath code and got some things working, but not entirely. My path is being calculated locally without AI/Target being placed on it (that means i can have them on moving island), but still my AI is trying to follow the path on the other location (which makes it fall off)

That is the topic that i found, and tried to use it’s solution:

Hi

There is an example scene for this. Check out the example scene called ‘Moving’. The scene is not that well documented, but it does work well. I think if you download the beta, the scripts that were required for the changes have been even more simplified than in the current release.

Isnt that ‘Moving’ example scene in Pro (paid) version of A*? I dont have it.

I checked if i have newest version of A*, (not paid one) and checked for every scene but there is no such scene as ‘Moving’ so im sure its in paid version :confused:

Hi

Ah. Yeah it is pro version only I’m afraid.
Here is the script that it uses (based on AIPath, which is similar to RichAI): https://pastebin.com/vdY20gi6
So the key idea is to every time you want to calculate a path, you transform your current position and target point to where they would be in a static graph (say positioned at the origin). Then you calculate the path and later when you follow it, you make sure to always transform back to the moving space whenever you get a point from the path (this needs to be done every frame, not just when the path has been calculated, otherwise when the object moves, the path will not move with it).