- Home /
Unity HostData connectedPlayers always return 1
Hi guys, I started a simple multiplayer game as a part-time interest, now I got all the connection stuff work except for an annoying bug, which is the HostData .connectedPlayers always return 1 even there are already 4 or 5 player connected to the host I don't know how to format my code, so I will post a screenshot of the code
So what I do here is first have a text field where you can filter the host by their name. And then for all the host that match the search, display their name, how many players are connected, and that's where the bug appears, like I said, it always return 1. I've searched the internet, and it seems there is nobody having complained the same problem. Maybe I just the unlucky one or is there anything I did wrong so that it cannot return the correct result?
Thank you very much.
Answer by shutongy · Oct 21, 2013 at 03:55 PM
I swear that the hostdata class couldn't show connected players correctly last week when I tested. But today it works. I guess the network was crazy or I was just crazy. I will mark it as solved.
Same with me. I'm trying to make it so that if there is more than 1 person connected it won't show the server, so that each server only has one player.