Before updating to Windows 10 you may need to return your Pro license. More information here

Photon RPC problem...

ive got this error: PhotonView with ID 5001 has no method "EquipItemShared" that takes 1 argument(s): String

That is my script:

 if(GUILayout.Button ("Equip"))
                                         //Load the item.
     void equipItem(string itemNameShared)
         //Will quip the selected item.
         GameObject weaponUsed=PhotonNetwork.Instantiate(itemNameShared,GetComponent<P_combat>().handBone.transform.position,GetComponent<P_combat>().handBone.transform.rotation,0);
     void EquipItemShared(PhotonMessageInfo info, string NameShared)
         if(info.sender.ID != PhotonNetwork.player.ID)
         {//Will show item equipment for other players.
     void callEquipItem(PhotonTargets target,string itemNameShared)
     {//Will call "Fire" for the given targets.

It happends when I press the equip button as you see.

more ▼

asked Jun 08, 2013 at 06:08 PM

avatar image

229 91 83 88

Is photonView the NetworkView component of the game object containing this script ?

Jun 08, 2013 at 06:21 PM KiraSensei

No, a different script, why?

Jun 09, 2013 at 02:18 AM benk0913
(comments are locked)
10|3000 characters needed characters left

3 answers: sort voted first

Photon RPCs can take a PhotonMessageInfo parameter as the last parameter in the method. You have it as the first. Try switching your parameters around and take a look at this:


Have a good day!

more ▼

answered Nov 04, 2013 at 08:57 PM

avatar image

506 2 6 14

(comments are locked)
10|3000 characters needed characters left

RPC is a method you call from a network view, not a script.

You need to attach a network view component to the game object containing the script.

Have a look at the documentation.

Your target needs a network view too, with this script attached too (it needs to know the "EquipItemShared" method too).

more ▼

answered Jun 09, 2013 at 08:17 AM

avatar image

3.6k 95 97 111

Appearntly it didnt change anything, I'm using photon by the way.

Jun 09, 2013 at 10:54 AM benk0913

It didn't change anything, so the same error is displayed ?

Jun 09, 2013 at 10:59 AM KiraSensei

yep.. Same error. I guess it works alittle different with photon.

Jun 09, 2013 at 11:22 AM benk0913

Did you attach a photon view to the target ? The error message is quite explicite...

Jun 09, 2013 at 11:43 AM KiraSensei

Yep. I did.

Jun 09, 2013 at 03:31 PM benk0913
(comments are locked)
10|3000 characters needed characters left

try PhotonPlayer targetPlayer instead of PhotonTargets target. i don't know but I used this in mine and it works.

more ▼

answered Jun 02, 2014 at 08:58 AM

avatar image

336 1 4 7

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments



asked: Jun 08, 2013 at 06:08 PM

Seen: 3895 times

Last Updated: Jun 02, 2014 at 08:58 AM