Having issues with strings through RPC's
Foestar
✭
So I'm picking up PUN 2 pretty easy so far but I'm struggling with a small issue involving a string. I have it so each player has a string for firstPlace, secondPlace, and thirdPlace. I also have a string called nameToBeSent. This string is given the player's nickname/alias like so.
Then I send the RPC to everyone with the string inside it like so.
So this is where the problem begins. I then make a text field equal the place, in this case 1st, along with the name. This much does work. The next part however doesn't and I can't seem to figure out why it wont no matter what I try. I'm trying to make it update so the firstPlace string for every player equals that same name so they register that a person is in that place. However, if I make it equal it it doesn't show, and if I add/equal it again it doesn't show. What am I doing wrong?
nameToBeSent = PlayerAliasMenuControl.PlayersAlias;
Then I send the RPC to everyone with the string inside it like so.
base.photonView.RPC("FirstSent", RpcTarget.All, nameToBeSent);
So this is where the problem begins. I then make a text field equal the place, in this case 1st, along with the name. This much does work. The next part however doesn't and I can't seem to figure out why it wont no matter what I try. I'm trying to make it update so the firstPlace string for every player equals that same name so they register that a person is in that place. However, if I make it equal it it doesn't show, and if I add/equal it again it doesn't show. What am I doing wrong?
[PunRPC] public void FirstSent(string nameToBeSent) { FirstPlace.GetComponent<Text>().text = "1st: " + nameToBeSent; firstPlace += nameToBeSent; }
0