A* Pathfinding with moving platform

This is a question related to the the A* Pathfinding project (A* Pathfinding Project)

I have two black platforms as shown in the image below. The blue part is a bridge.
Both the platforms and the bridge are walkable.

The goal is for the red dot on the right-hand side platform to reach the green dot on the left-hand side platform. The red dot’s platform can be moved so that it touches the bridge.

When the scene starts, the red dot walks towards the green dot and stops at the edge of the platform as expected, since it can’t reach it.
Problem is that after the red dot has stopped, when I move the platform to touch the bridge, the dot will try to go back to the position where the platform used to be, sometimes falling down, instead of just “following” the platform as I move it.

So I would like to:

1.- Know when the dot has reached the edge of the platform and that it cannot move further, so when I detect that, I move the platform towards the bridge (at this point I guess the original path of the red dot should be reset or cleared somehow so that it doesn’t try to move while green dot is still unreachable)
2.- As soon as the platform touches the bridge, the red dot should detect that the green dot is now reachable and it should move towards it.

Have looked for several examples online but haven’t been able how to figure this out.

Any help is appreciated!


One trick you can do :

Step 1 : Build a nav mesh which contains all the path of the moving platform.

Step 2 : Create invisible moving walls around the platform, parented to the platform (to follow its movement)

Step 3 : Add a the Nav Mesh Obstacle component on the invisible moving walls.

Step 4 : Try if it works as you want.

Sorry, I don’t follow.

Are you saying to use Unity’s Navmesh obstacles together with the A* pathfinding project?

I don’t want to have to mess with Unity’s AI engine and A* at the same time. Either one or the other.

There has to be some way with the A* pathfinding project to tell if a target is reachable.

Some way that can tell me:
Is target reachable? No, then move platform.
Is it reachable now? No, keep on moving platform…
Is it reachable now? Yes, move red dot to green dot.

It’s just that still I don’t see how to use it.

Thanks anyway.

Were you able to implement this? I need some help doing pathfinding for my app