Finding corresponding GameObject on another Player
Options
I'm working on a card game; I decided to set it up so that Player 1 is the host, everything that happens on Player 1 gets synced back out to the other player. All my cards have PhotonViews, and are sending RPCs back to Player 1, things get processed and the results get synced; no problems.
I have a function that attaches one card to another, and it uses one GO as the argument. Obviously, I can't tell the card on Player 1 to attach the actual GO from Player 2; I need to find the same GO on Player 1.
Seems to me there ought to be a function that does this already, but I am having trouble finding it.
Any alternate suggestions on how to accomplish this goal would also be appreciated; I am fully aware that I might be going about it in the wrong way.
I have a function that attaches one card to another, and it uses one GO as the argument. Obviously, I can't tell the card on Player 1 to attach the actual GO from Player 2; I need to find the same GO on Player 1.
Seems to me there ought to be a function that does this already, but I am having trouble finding it.
Any alternate suggestions on how to accomplish this goal would also be appreciated; I am fully aware that I might be going about it in the wrong way.
0
Comments
-
I figured it out... For anyone else who wonders, ViewID is the same across clients, so if you need to pass a GO, just get the ViewID, pass that, and use that to find the corresponding GO on the other client.0
-
Thanks for updating us on your progress and good you could find a solution!
RPCs also get executed on the same GO on all clients (the GO that is identified by the PhotonView / ViewID).
So using an RPC might be a thing to consider.0