"AI helping the same AI

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By timeofdeath12
:warning: Old Version Published before Godot 3 was released.

Hello. So I’m trap in a problem where I want an AI (psycho) that by the time he is in aggressive mode he runs toward the player and if the psycho passed by another psycho who’s in idle, that idle psycho will become aggressive.

There’s an easier way where to create multiple enemies with different names but it’s not efficient

:bust_in_silhouette: Reply From: Tegu

You could add all your psychos to a group. Then, you could check in your _on_area_body_enter callback if the entered body is in the group and also if it’s in the aggressive mode.

Here is some documentation about groups: http://docs.godotengine.org/en/stable/learning/step_by_step/scripting_continued.html#groups