Two bodyguard around boss

Which conditions should i use to check if a boss have around al least two bodyguards ?

the is a condition that checks number of objects.

@Slash thank you, but how can i understand if there are two bodyguard AROUND the boss. (not too far )

Maybe the “Distance between two objects”.

put in your numbers and your actions

1 Like

it doesn’t run. sorry.
there are many bodyguards into the scene, but the boss need only two guards around him.
if one bodyguard around the boss die, one of the other bodyguard must to go to help the boss. So the number of bodyguards near the boss are always two.

if you do show your events and explain exacly what doesnt work you could get more precised help.
as for now, try distance to boss first and number of guards as a subevent of it.

Perhaps you can a “role” attribute to your guards that defaults to “none” but can be set to “bodyguard”.
Then you can have a condition like:

variable “role” of Guards = “bodyguard”

Count(Guards) < 2

Pick nearest Guard to Boss => variable role of Guard = “bodyguard”

1 Like

One thing is only to check if there are two bodyguards around the boss and another to do all the mechanics to check it and if there aren’t, the bodyguards goes with the boss. You can use a switch system with variables…is simple and, i just tested it and it works perfectly.
3 events…
1) CONDITION: Bodyguard distance to Boss is below to…(put the distance you want)
A child event with ACTION: Change the object variable “Bodyguards” (for example) of Boss set to “Count(Bodyguard)”.
2)CONDITION: Object variable “Bodyguards” of Boss is ≥ 2; trigger once.
ACTION: you have to put your action when 2 bodyguards are near to the Boss.
3)CONDITION: Object variable “Bodyguards” of Boss is < 2 ; trigger once.
ACTION: you put the action you want when there aren’t 2 bodyguards around the boss.

thank you @Points @krunkster and @Slash.