I am working in Godot 3.0 on some utility functions to use in my enemy state logics.
I want to write a function which determines whether the platform the enemy is standing on is connected to the platform the player is standing on.

My platforms are StaticBody2Ds
with either CollisionShape2D
(rectangle) or CollisionPolygon2D
children.
It's easy to get the platforms the enemy and player are standing on. I just raycast down and create references to the colliders.
But how can I determine whether these two platforms are connected?
How can I determine whether there is a chain of StaticBody2Ds
connecting two StaticBody2Ds
?
Could something be done with GraphNodes
? Maybe manually creating a graph on top of the platforms with connections between the platforms being represented in the graph? I'm not sure, since I've never used the GraphNode
and I don't know how it works.