I have a verse device that shows a team selection canvas to all players after 2 seconds from the game start.
I use a for loop to give it to every player. The problem is that the canvas widgets are only assigned to one player. What’s weird, is that on the screen where the widgets are not shown, the mouse appears, as the canvas is being assigned, but there are no widgets on the screen.
This is the method:
InitPlayers():void=
for(Player : GetPlayspace().GetPlayers()):
if(set ActualTeam[Player]=false){}
if(PlayerUI:=GetPlayerUI[Player]):
PlayerUI.AddWidget(MainCanvas, player_ui_slot{InputMode:=ui_input_mode.All})
if(set MaybeMyUIPerPlayer[Player] = option{MainCanvas}){}
What could be the problem?
MainCanvas
is a var where I put the MakeMainCanvas method, which is a classic MakeCanvas method which returns the canvas.
I tried to put the for inside OnBegin and call InitPlayer method everytime but nothing changes.
Am I making some mistakes?