# Two bodyguard around boss

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

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â€ť.

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.