Get which sides an Area2d is overlapped with

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Vercte

Hello! I’m fairly new to the engine.

I’m trying to get which sides an Area2d is overlapped by, so I can push the player back if they’re walking into a wall.

Is there a specific way I can do this?

I’m trying to get which sides it overlaps (e.g. left, right, bottom, top), not what it overlaps. Thank you for looking around a bit, though!

Vercte | 2022-03-25 20:58

I guess Area2d has no collision points

Getting the global_position of the object entering the Area
Of course, there are other solutions as well.

ramazan | 2022-03-26 09:30