Check if Client
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).
Check if Client
SullyBully
2019-07-14 11:06:49
So in my game, when I finished putting photon views on everything, and when I tested out the game, I could control the two players with the same controls!
In uNET, all I had to do was check "localPlayer" and that would fix everything.
Is there anyway to do this with PUN?
Comments
SullyBully
2019-07-14 11:21:18
Edit: I got it to work by using "if (!PhotonNetwork.LocalPlayer.IsLocal)
return;"
Hi @SullyBully,
if your class inherits from <i class="Italic">MonoBehaviourPun</i>
you can use
bool isLocal = photonView.IsMine || !PhotonNetwork.IsConnected;
<i class="Italic">!PhotonNetwork.IsConnected</i>
is there for the case when you want to run your map without connecting to the server.