How do I test overlap between 2DAreas?

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

I want to know how to detect if a moving 2DArea will enter another 2DArea before they enter eachother, similar to how “test_move” works, I want to set a virtual position to check overlap before actually moving the instance. The built-in “area_entered”-like connections only work after the Areas have already entered each other.

I am new to Godot and I’m using this project to make a 2D Platformer, where my player extends a 2D Area. I am very adamant about using custom physics and collision detection, so it was frustrating when the only tutorials and help I could find were for Godot’s built-in physics using the KinematicBody2D. The only helpful response to my question is an answer to my question, I politely ask that you don’t respond with something like “try something else completely”, I only want to know how to detect overlapping 2D objects using a virtual position to check collisions before the collision has occurred.

:bust_in_silhouette: Reply From: exuin

How about using a RayCast2D and casting it in the direction that the player is moving?