# Figuring out which team captured the objective

**URL:** <https://forums.unrealengine.com/t/figuring-out-which-team-captured-the-objective/1336989>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, question, fortnite\
**Created:** [October 18, 2023, 6:52pm UTC](https://forums.unrealengine.com/t/figuring-out-which-team-captured-the-objective/1336989 "2023-10-18T18:52:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![TurnipSurprise](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TurnipSurprise](https://forums.unrealengine.com/u/TurnipSurprise)\
**Post date:** [October 18, 2023, 6:52pm UTC](https://forums.unrealengine.com/t/figuring-out-which-team-captured-the-objective/1336989/1 "2023-10-18T18:52:25Z")

</div>

I have a simple map with a capture device and cylinder.  
There are 2 teams playing the game. If someone from team 1 captures the cylinder it turns green, if someone from team 2 does, it turns orange.

I’m trying to make this work in Verse.

Steps:

1. I use 2 x team\_settings\_and\_inventory\_device and set 1 to teamindex 1 and the other to teamindex 2
2. I subscribe to the capture device’s “OnControlChangeEvent” event.  
In the event I use some code I found in an example:  
TeamCollection := GetPlayspace().GetTeamCollection()  
if (AgentsTeam := TeamCollection.GetTeam[Agent]):  
TeamArray := TeamCollection.GetTeams()  
for (TeamNumber-\>Team : TeamArray):  
if (AgentsTeam = Team):  
if(TeamNumber = 0):  
# \*\*\* Make cylinder green \*\*\*  
else if(TeamNumber = 1):  
# \*\*\* Make cylinder orange \*\*\*

This works most of the time but not always.  
Issue is that there seems to be no correlation between the team index on the team settings device and the team / agent that captured the prize.  
The team number above is an index of an array which has a 50/50 chance of being in the correct order.

I have also tried using the “IsOnTeam[Agent]” of the team\_settings\_and\_inventory\_device but that always returns ‘false’.

Any help would be appreciated.
