hi , i have this function that i want to send player’s name:
[RPC]
public string getName() {
return playerName;
}
and i want to recvie it by this where name is string:
name = GetComponent<BetaMovement> ().photonView.RPC ("getName", PhotonTargets.AllBuffered);
it gives me error that i convert void to string … so how do i use the rpc call to ‘attach’ this to name variable ?
or maybe some other idea for getting info who killed who.
i currently send the data to the bullet object that i create and send messa
photonView.RPC is void so you can’t return things from it like that. Doesn’t matter what the RPC’d method’s signature is.
so what’s the solution to this problem ?
Um - don’t try to assign the result of an RPC call to something…
ok so i have method getName when i call it the problem is that 20 % times it doesnt work 80 % time it works … have no idea why so i thought to call it as RPC becouse maybe everybody did not get this or something
You can set each user’s name via: PhotonNetwork.player.name.
It’s synced for you and you can have each user’s name in PhotonNetwork.playerList*.name.*
Yeeeeeeeeeeeeeeeeeehaaaaaaaaaaa
Thanks brother you saved me a lot of stress