Is there ANY possible way to make an Area2D do the overlapping areas check when I want it to

Godot Version

4.7.1

Question

func _physics_process(h):
  position.x += whatever
  # right after moving I want to check if our area has bumped into any new areas without waiting for the next physics frame

using the _on_area_entered signal can’t help me here

Look at the Area2D class reference in the docs. There’s get_overlapping_areas() function.

That said you can do it even with entered/exited signals. Maintain an area list and add an area to the list when it enters and remove it when it exits. Such list will at all times contain all of the areas that currently overlap the given area.

doesn’t it say this? (I also already tried this)
image

as for the thing you said with a list and signals, I tried that and it didn’t work
I did something like this

var area_list = []

func _physics_process(delta):
   print(area_list)
   position.x += whatever # this line won't change area_list immediately, even if we move outside an area in there (that will only be seen in the next call)
   print(area_list) # would print the same thing as the first print statement

func _on_area_entered(area):
   area_list.push_back(area)
func _on_area_exited(area):
   area_list.erase(area)

You might be interested in PhysicsDirectSpaceState2D.intersect_shape() instead: PhysicsDirectSpaceState2D — Godot Engine (stable) documentation in English

Once per physics frame update should be sufficient for most typical use cases. The state used by signals will also update only on physics ticks, not immediately. Why do you need it immediatelly?

how do I get the PhysicsDirectSpaceState2D

get_viewport().world_2d.direct_space_state

With Area2D no, but you can use ShapeCast2D with force_shapecast_update for it.

ShapeCast2D — Godot Engine (stable) documentation in English