how to check if all players in the room enabled a GameObject
I'm using photon pun for a FPS game, I have a two canvases , one is the default and the other is enabled during game play
I want the players to be able to shoot each other only if all of them in the room has the gameplay canvas enabled
how can I check all players in the room has enabled a GameObject that is a scene object not linked to the player???
I know somewhat I need a boolean and set it true if the canvas enabled but how can I know every player has this boolean on true??
thanks for any help
Answers
-
Yes, every player needs to sync / share the state of some bool value for this.
You can do this with Custom Player Properties. Have a key in those and change the value via SetCustomProperties.
The Asteroids Sample has a "Ready" screen, which does something similar. Have a look.
0 -
thanks for your reply,
I took care of it by counting the number of player that join a room and send an RPC to count number of player that are ready , if ready players are equal to joined player then the action happens.
0