Does PhotonNetwork.LocalPlayer.NickName carry over scenes?
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).
Does PhotonNetwork.LocalPlayer.NickName carry over scenes?
Johan_Liebert96
2022-10-10 01:59:28
Hey, I'm gonna keep this short. Currently I'm using this to display players nickname in the lobby
PhotonNetwork.LocalPlayer.NickName = loginEmail.text;
playerNickName.text = PhotonNetwork.LocalPlayer.NickName;
The above code works, but I'm trying to display the players name above the player in the game scene, and I simply call
_playerNhame.text = PhotonNetwork.LocalPlayer.NickName;
Returns null though? Can I not set the localPlayers nickname?
Comments
You can set it and use it and in PUN it's independent from the scene and room.
Make sure it's being set. If it is, you can attach a debugger and check when it's being set to Null again. I am not aware of code in PUN that sets it to Null.
Back to top