Flashlight Sync Error [RPC]

I have a erro on my flashlight sync system, my code is:
using UnityEngine;
using System.Collections;

public class Lanterna : Photon.MonoBehaviour {

private bool lanternaON = false;
private bool correctLanterna = false;

// Use this for initialization
void Start () {

}

[RPC]
void lanterna(bool ligado) {
if(ligado==true){
light.intensity=5;
}else{
light.intensity=0;
}
Debug.Log("Acionado");
}

// Update is called once per frame
void Update (){
if(Input.GetKeyDown(KeyCode.L)){
this.lanternaON = !this.lanternaON;
PhotonView photonView = PhotonView.Get(this);
photonView.RPC("lanterna", PhotonTargets.All, this.lanternaON);
//Debug.Log(this.lanternaON);
}
}
}

Comments

  • And the error is?
    Sorry, but we can't debug just any dropped code here. In best case, try to debug this yourself. Read the error / exception logged. Read it again. Try to understand it. Look at the code that's giving you the error.
    If it's not a exception / error, try to think about the logic you try to achieve and why it fails.

    If neither helps: At least describe what fails how, where and what you want to achieve.