Sent a method to other clients all object has the same

Options
Hello, I'm a new to PUN,there are some questions that I don't understand,please help

As the title said,I tried RPC, but it seems like it only sent to the same ID as sender ID and has same Script(Not Sure) and has same method -Object

So if there are Objects
in ClientA:
From ASelf : A-Object, has A-PhotonView, has A-Scripts, A-RPCMethod
From ClientB:B-Object, has B-PhotonView, has A-Scripts, A-RPCMethod

in ClientB:
From ClientA: A-Object, has A-PhotonView, has A-Scripts, A-RPCMethod
From BSelf:B-Object, has B-PhotonView, has A-Scripts, A-RPCMethod

*From Self means it PhotonNetwork.Instantiat-ed by it, From means it PhotonNetwork.Instantiat-ed by others

So when ClientA use A-Object,A-PhotonView,A-Scripts send A-RPCMethod to PhotonTargets.All
it only affects self A-Object and ClienB's A-Object

is this result right?
I need someone to confirm this logic,thanks

If this is right
then how can when ClientA call a method, then the targets all objects all have this method be called
and if it can use PhotonTargets?

BTW, I'm Taiwanese, so my English may really bad, sorry about that.
THANKS

Comments

  • vadim
    Options
    So when ClientA use A-Object,A-PhotonView,A-Scripts send A-RPCMethod to PhotonTargets.All
    it only affects self A-Object and ClienB's A-Object
    Yes, PhotonTargets.All means that RPC will be called on all instances of object over network including calling client intself.
    then how can when ClientA call a method, then the targets all objects all have this method be called
    and if it can use PhotonTargets?
    To call RPC for all object you need to explicitly iterate through all the objects and call RPC one by one.