Problem with PhotonView.RPC

hi, i am new to unity and photon networking and i am converting my Maltiplayer game made using ultimate unity networking into Photon networking. with the tutorial(came with sdk) i have converted my all unity networking code to photon networking using photon converter. i have fixed all the bugs but at runtime i have having problem with PhotonView.RPC method. it is giving me this error.

“PhotonView with ID 1000 has no method “SetCurrentCharacter” that takes 0 argument(s):”
and my code is as follows.

void SetupAvatar(int characterId)
	{
		if (character != null)
			PhotonNetwork.Destroy(character);
		character = (GameObject)PhotonNetwork.Instantiate(characterPrefabs[characterId], Vector3.zero, Quaternion.identity, 0);
		
		// Sync Avatar configuration
		if (PhotonNetwork.isNonMasterClientInGame || PhotonNetwork.isMasterClient) {
			Debug.Log("Before Set Current character!!!");
			photonView.RPC("SetCurrentCharacter", PhotonTargets.AllBuffered);
		}
	}

	[RPC]
	void SetCurrentCharacter(PhotonViewID characterViewId)
	{
		Debug.Log("Set Current Character Method!!!");
		PhotonView view = PhotonView.Find(characterViewId.ID);
		
		if (view == null)
		{
			PhotonNetwork.Destroy(gameObject);
			return;
		}
		
		character = view.gameObject;
		character.transform.parent = transform;
		character.transform.localPosition = Vector3.zero;
		character.transform.localRotation = Quaternion.identity;
		
		_animation = character.animation;
		if (_animation != null)
			enabled = true;
	}

i do not know how to get the photon View id so i can pass it as a parameter in this method.

any help will be greatly appreciative.
thanks.

BUMP: I have the same problem

Your method is looking for a PhotonViewID, which you don’t specify in your RPC call.

Should be:
photonView.RPC(“SetCurrentCharacter”, PhotonTargets.AllBuffered, );

Your RPC called SetCurrentCharacter accepts one argument of type PhotonViewID. When you call the RPC

photonView.RPC("SetCurrentCharacter", PhotonTargets.AllBuffered);

You have to specify the arguments that the RPC takes. Example:

photonView.RPC("SetCurrentCharacter", PhotonTargets.AllBuffered, photonView.viewID);

Note: There is a limited selection of data types you can pass as RPCs. Look here for a list of available types.

Your SetCurrentCharacter method has attribute RPC. It must have attribute PunRPC like this …

 [PunRPC]
 void SetCurrentCharacter(PhotonViewID characterViewId)