Problem receiving teams

I encountered a problem that when the round ends, the teams move. But using this code, the player always ends up in team 1, although he is in team 2. I tried to test it in every possible way, but I couldn’t find a solution. Does anyone have any thoughts on this matter. I checked via verse there are two teams in the game

AllPlayers := GetPlayspace().GetPlayers()
                    for (Player : AllPlayers):
                        if (Agent := player[Player]): 
                            if(GetPlayspace().GetTeamCollection().GetTeam[Agent] = Teams[0]):
                                Print("TEAM 1")
                                TeleportRed.Teleport(Agent)
                            else if(GetPlayspace().GetTeamCollection().GetTeam[Agent] = Teams[1]):
                                Print("TEAM 2")
                                TeleportBlue.Teleport(Agent)

I’ve experienced what is perhaps the same issue when managing teams through verse, does this code behave the same when you upload to a private version vs. testing through an edit session connected to the editor? I’ve had similar team assignments behave differently with an uploaded private version vs. the edit session and am wondering if it’s some sort of project validation bug. Might have to do with matchmaking wanting to always fill teams on the backend? Never really figured out what caused the problem when I was messing with it though. Hope it at least saves some time troubleshooting…

Thank you for your report! Can you please re-post using the “New Issue” option on the Issues and Bug Reporting forums? Posts with this feature are connected directly into our development team so we can quickly get to them!

For more information, such as how to get the reference ID, please check out the article here: Using the Creative and UEFN Bug Reporting Form

behavior is the same in private and public versions