A
A
Alexey Fobius2021-10-14 10:02:58
C++ / C#
Alexey Fobius, 2021-10-14 10:02:58

How to change player variable in Photon Unity?

Each player has a variable (let's call it points).

So, I'm trying from one player's script to change this variable for another player, but it doesn't work out.

What I tried:

[PunRPC]
photonView.RPC("метод", RpcTarget.Others);

In English, I also didn’t find anything special, there are the originals of those articles / questions, the translations of which I found earlier, but in the office. I don’t understand Photon’s documentation where to dig, I also looked for the methods described earlier there and tried to implement according to the documentation - the effect is the same

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nekit Medvedev, 2021-10-14
@NIKROTOS

Does the standard not work? (public method that changes a private variable)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question