- Home /
How to change value Photon
I made game horor3d, in game there is keys When the player steps on the key, the variable should + 1 in another script, but it does not work here is my script
using UnityEngine; using UnityEngine.UI; using Photon.Pun; public class KeyMechanics : MonoBehaviourPunCallbacks { public ManagerKeys mgk; public PhotonView pv; void OnTriggerEnter(Collider other) { if (other.gameObject.CompareTag("Player")) { PhotonNetwork.Destroy(gameObject); pv.RPC("AddKey", RpcTarget.AllBuffered, mgk.Keys); } } [PunRPC] void AddKey() { mgk.Keys++; } }
Your answer
Follow this Question
Related Questions
Update int value with photon rpc? 0 Answers
Sending int value owned by Masterclient to other client 2 Answers
Photon change int 0 Answers
MMO Server backend: Smartfox or Photon 2 Answers
Unity Error on build not in editor? 0 Answers