0 votes

What is the best way to check collisions between Area2D? (In addition to using the old "if area is preload (path)", which ends up in many cyclic dependency problems.

asked Oct 20, 2019 in Engine by JulioYagami (637 points)

1 Answer

+1 vote
Best answer

Areas can detect overlap with other areas in two ways:

1) Using area_entered and area_exited signals.
2) Using get_overlapping_areas().

Generally speaking, option #1 is the most reliable, as get_overlapping_areas() is only updated once during the physics step, and so may not be accurate if the areas are moved before you call it.

answered Oct 20, 2019 by kidscancode (17,714 points)
selected Oct 21, 2019 by JulioYagami
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.