- Home /
GUI.Label inside a foreach loop?
I'm trying to display a HUD for each player in the room, my first thought was to add a float and after displaying all items, add to that value so the next item will be under it, but this then occurs in all of the items in the foreach loop to scroll down continuously...
foreach (PhotonPlayer player in PhotonNetwork.playerList) {
GUI.Label(new Rect(400, 15+ yOffset, 200, 25), player.name);
yOffset += 30F;
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613191218im_/https://answers.unity.com/themes/thub/images/avi.jpg)