PUN 2 how to reference yourself?
Options
I am trying to set up a system in my game where the LocalPlayer has the ability to start the game once all players have joined.
Basically, is there some way for the game to check if a player is the LocalPlayer/host?
The equivalent of this psuedocode:
if(PhotonNetwork.LocalPlayer.IsMe)
{
ShowMenu();
ShowStartGameButton();
}
else if(!PhotonNetwork.LocalPlayer.IsMe)
{
ShowMenu();
}
Basically, is there some way for the game to check if a player is the LocalPlayer/host?
The equivalent of this psuedocode:
if(PhotonNetwork.LocalPlayer.IsMe)
{
ShowMenu();
ShowStartGameButton();
}
else if(!PhotonNetwork.LocalPlayer.IsMe)
{
ShowMenu();
}
0
Comments
-
Hi @BlitzBurn,
Thank you for choosing Photon!PhotonNetwork.LocalPlayer
is always referring to the local client.
Otherwise you could use the helper properties:Player.IsLocal
PhotonView.IsMine
0