Help finding nearest area without collisions
Hi all! I'm a web dev who's new to game dev and Godot. I'm currently working on my first game, and I could use some help.
I need help figuring out how to do the following:
To spawn an area (a rectangular Area2D of a predefined size) centered on a target position. If there are collisions where it would spawn, to instead spawn it (or move it) the least distance from that target position to where there are no collisions.