2

I'm making an online game and when a ball hit by a player hits another player, I want to get that player's name from OwnerActorNr.

photonView.OwnerActorNr

Is it possible to get player information from this number?

Beginner_
  • 645
  • 1
  • 11
  • 27
  • just access `photonView.NickName` – Ron Mar 08 '20 at 09:57
  • photonView.NickName gets only the name of the owner of the photonView. I mean, I want to get that player's name from another player's OwnerActorNr. Like PhotonView.GetName(int ActorNr). – Beginner_ Mar 09 '20 at 10:24
  • when you access `photonView.OwnerActorNr` you get the actor number of the given photon view. so even if you sent it somewhere else to handle it, it will return the name of the given photon view. or if you have only the actor number without the photon view, you could find it in `PhotonNetwork.PlayerList` – Ron Mar 09 '20 at 13:05

1 Answers1

2

You can use PhotonNetwork.Currentroom.GetPlayer(ActorNumber);

It will return the player. You can use the player properties like nickname, etc..

Peter Csala
  • 17,736
  • 16
  • 35
  • 75
Amit
  • 36
  • 2