Need help. How to enable lobby statistics?
The whole answer can be found below.
Try Our
Documentation
Please check if you can find an answer in our extensive documentation on PUN.
Join Us
on Discord
Meet and talk to our staff and the entire Photon-Community via Discord.
Read More on
Stack Overflow
Find more information on Stack Overflow (for Circle members only).
Need help. How to enable lobby statistics?
PhoenixRise
2019-03-20 17:43:06
Hello, I want to use the OnLobbyStatisticsUpdate() function. But the documentation says you have to enable lobby statistics. The docs say do this:
PhotonNetwork.EnableLobbyStatistsics = true;
(Which is read only)
And this:
LoadBalancingClient.EnableLobbyStatistics = true;
(Which gives the error "an object reference is required")
I've also tried:
PhotonNetwork.PhotonServerSettings.EnableLobbySatistics
Comments
PhoenixRise
2019-03-20 18:00:47
Also I'm using PUN 2
Hi @PhoenixRise,
Thank you for choosing Photon!
The proper way to enable lobby stats in PUN2 is, as shown in the docs page here:
PhotonNetwork.PhotonServerSettings.EnableLobbySatistics = true;
These work when you connect using PhotonNetwork.ConnectUsingSettings();
as that's the only connect method that actually makes use of the ScriptableObject ServerSettings.
If you need to use another connect method, then you should use PhotonNetwork.NetworkingClient.EnableLobbyStatistics = true;
before connecting.
PhoenixRise
2019-03-21 16:44:10
Oh ok.ty so much for explaining that.
KapilKhatik
2022-05-06 19:25:56
How to implement this code to show no. of active players in the current lobby? I'm confused about how to implement this? Can you guide me with some resources? It'll be very helpful to me thanks.
Back to top