Hi Godot community.
I have something which has me totally stumped.
I have a project in which I instantiate characters which two teams fight one another. The issue is that one type of character uses the standard 'body entered' signal on an Area2D node to detect enemies coming into its 'aggro' range.
At seemingly random intervals this signal is triggered when an enemy is instantiated into the game; they are not yet in the Area2D range (or are nowhere near it).
I can spawn 10 characters (5 team red, 5 team blue) and anywhere from 1-3 on team red will instantly engage team blue (all of them) as soon as team blue is spawned.
The code can literally be boiled down to:
And some characters using this script will instantly detect and print every body in the playing field, and others will just chill out until the body actually gets in range.
I hope someone can help and I hope I've given enough info to trigger a lightbulb for someone who has seen similar issues.