Check if player is in a room

Options
Hi All,

This is probably an easy question although I can't find it on the documentation anywhere probably just blind.

My question is simple: How do I check if a PUN player is in a room? Not when he joins a room, but if he is in a room.

I want to do this as validation for a mouse lock script. I want a section in a script to run only if the player is in a room. I wish to do this on a different script for modularity.

Any solutions?

Comments

  • vadim
    Options
    Hi,

    PhotonNetwork.inRoom returns true if client is connected to a room.