The Photon Forum
is Closed Permanently.

After many dedicated years of service, we have made the decision to retire our Forum and switch to read-only: we´ve saved the best to last! Your search result can be found below. Plus, we offer support via these channels:

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).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

Can we Set PhotonNetwork.NickName after Joining a room? And/Or even after Leaving Lobby?

GvNiK
2023-03-21 16:19:34

I have been using Photon for my projects, and till now I have been setting the  PhotonNetwork.NickName value before joining any room, while being in a lobby. And all works great with this method.

But in my current project, there's a need where I need to set the  PhotonNetwork.NickName after joining a room. The lobby condition can be changed - In my current case, player leaveLobby as soon as player joins a room. I even tried without leaving lobby, still won't work.

A little help on this would be appreciated.

Thank You.

Comments

Tobias
2023-03-22 12:42:39

Joining or leaving a Photon Lobby does not have any effect on the NickName.

You can set the NickName before you join a room or after you joined one but not after join/create and before the OnJoined callback (there is a transition time in which the client switches servers, etc).

Back to top