Second player's variables are null but not player one's

I am using PhotonNetwork.Instantiate to instantiate a player.
I am using a game object called "NetworkManager" that is placed on the scene from the start.
Both players should have access to this as it is there from the start

Whenever I am calling a string, say a prefab's name.
On the master client, the name shows up just fine. On the second player's screen however, its set as null.
From Unity's inspector however, player 2's string is NOT null and is in fact populated, however the game still says it is null.
Why is this? I am using stream.sendNext() and stream.receivenext()to always have the string updated.

Am I missing something here?

Comments

  • Whenever I am calling a string, say a prefab's name.
    Do you mean accessing NetworkManager object string property synchronized with OnPhotonSerializeView?
    From Unity's inspector however, player 2's string is NOT null and is in fact populated, however the game still says it is null.
    So Unity inspector and game check different strings ? Can game access same variable as inspector?
  • vadim wrote:
    Whenever I am calling a string, say a prefab's name.
    Do you mean accessing NetworkManager object string property synchronized with OnPhotonSerializeView?
    From Unity's inspector however, player 2's string is NOT null and is in fact populated, however the game still says it is null.
    So Unity inspector and game check different strings ? Can game access same variable as inspector?

    Yes the variable is updated using onphotonserializeview

    So on master client, unity inspector says String A = "Bomb"
    On second player's client, unity inspector says String A = "Bomb"
    I can even change the string while the game is running manually through the inspector and it will update correctly on both clients.

    Then when I use Debug.log(string A) on the second client, the log just returns string A as an empty string. I've been stuck on this for days now.
  • You definitely use Debug.log(string A) in wrong place or for wrong object.
    Make sure that you reference exactly same object as Unity shows in inspector
  • vadim wrote:
    You definitely use Debug.log(string A) in wrong place or for wrong object.
    Make sure that you reference exactly same object as Unity shows in inspector

    I am calling the debug log from the same script that has the string.
    By that I mean: script A has string A. I call debug.log(stringA) from script A.

    This works fine on player 1, but player 2 comes up null.
    I am calling these in an RPC call.