SYNC DATA

Options
I have rooms of 2 players and i want them to be in different scenes!
For example: i have player 1 health and player 2 health
I want to sync these 2 variables.

Comments

  • OverTheMoon
    Options
    As long as you control your PhotonView ids, this should be possible.

    My (limited) understanding is that photon doesn't particularly care about unity's scenes. On the server, there's rooms you can join, at which point data will begin being transfered back and forth between players. Incoming data will just say "Hey! I've got some data here, and it's supposed to be delivered to a PhotonView with 12 as an ID". If one client has a different scene open with an object with a PhotonView id of 12, I believe Photon will simply try to apply the incoming data to that scene.
  • LionMan
    Options
    It's not working, i'm stuck for about a week now, i can't find any solution to do that. Send me an example or something, how can i do this? I have player 1, in scene 1, and player 2, in scene 2. My scrips has playerHp1 and playerHp2, playerHp1 is for the player in the first scene and playerHp2 for the player in the second scene. How can i sync those 2 variables? In the first scene i need playerHp2 and in the second scene i need playerHp1!