In my game, the world is divided into multiple rooms, each with an Area2D
that encapsulates its bounds. I want to be notified (preferably via signals) when a specific point (e.g. Position2D
) enters each rooms so that I can keep track of where my player character is and react accordingly with e.g. the camera.
I'm currently using the character's CollisionShape2D
and Area2D
's body_entered
signal to achieve this, but it would be better if I could know when the center of the player enters the room, rather than when the edge of the player does so.
Is this possible without having to e.g. constantly query each room and check whether the player's current position lies within the bounding box?
Thanks in advance!