0 votes

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

asked Oct 19, 2017 in Engine by timeofdeath12 (23 points)
edited Oct 19, 2017 by timeofdeath12

1 Answer

+2 votes

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

answered Oct 19, 2017 by Tegu (18 points)
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.