How to use PunRPC with multiple copies of a component
Options
Hi,
I have a Weapon component that it's used to configure different weapons for a character.
So for example there's one gameobject for the player which contains 4 Weapon components.
In UNET, you can use RPC calls without problem, but when I switched today to PUN I've found this error:
Is there an easy way to handle multiple components that use RPC?
Thanks!
I have a Weapon component that it's used to configure different weapons for a character.
So for example there's one gameobject for the player which contains 4 Weapon components.
In UNET, you can use RPC calls without problem, but when I switched today to PUN I've found this error:
PhotonView with ID 1002 has 4 methods "RpcFire" that takes 0 argument(s): . Should be just one?
Is there an easy way to handle multiple components that use RPC?
Thanks!
0
Comments
-
For now there is no solution.0
-
Sad to hear that. Is this feature planned to be supported?
This is the workaround I'm using right now, hope it helps others:
·Weapon component has a weaponIndex as ID.
·The RPC call sends the ID, and the method checks if it's the same ID.
It's far for perfect, but right now it's the only fix unless I rewrite the entire weapon system.
0