title: How do use Rpc in unity photon (script not working)
body: <p>Here I made a simple flashlight script in unity photon multiplayer using RPC the script set active and false the game object FlashLight. When I run the game I seem to be getting no errors in the console. Anyway, 2 clients are not syncing the FlashLight changes</p>
  <pre><code>using System.Collections;
  using System.Collections.Generic;
  using UnityEngine;
  using UnityEngine.UI;
  using Photon.Pun;
  
  public class flashlight : MonoBehaviourPunCallbacks
  {
      public GameObject FlashlightLight;
      private bool flashlightActive = false;
      PhotonView view;
      public GameObject player;
      //public bool active;
  
  
  
      void Start()
      {
          view = this.GetComponent&lt;PhotonView&gt;();
  
      }
  
      [PunRPC]
      public void Light(bool active)
      {
          if (view.IsMine)
          {
  
              if(active == true)
              {
                  FlashlightLight.gameObject.SetActive(true);
              }
  
              if(active == false)
              {
                  FlashlightLight.gameObject.SetActive(false);
              }
  
  
          }
      }
  
      void Update()
      {
          if (Input.GetKeyDown(KeyCode.F))
          {
              view.RPC(&quot;Light&quot;, RpcTarget.AllBuffered, true);
              
          }
  
          if (Input.GetKeyDown(KeyCode.G))
          {
              view.RPC(&quot;Light&quot;, RpcTarget.AllBuffered, false);
          }
          
          
      }
  
  
      
  
  }
  </code></pre>