Search Unity

NetworkIdentity's asset Id resetting to zero when alt-tabbing to editor

Discussion in 'Multiplayer' started by lightlessone, Aug 6, 2017.

  1. lightlessone

    lightlessone

    Joined:
    Sep 26, 2015
    Posts:
    1
    I'm using Unity's example lobby scene and I've encountered very strange behaviour:
    when I start hosting from editor (by pressing "Play and Host"), and there appears local lobby player prefab, it has valid asset Id, but when editor window loses focus (e.g. alt-tabbing), it's asset Id becomes zeroes.
    When I build it and run it, it doesn't happen (I'm tracking asset Id by showing it in UI).
    Before losing focus:
    After:
    What seems to be somehow connected, is material, appearing on PlayerInfo prefab:

    After each alt-tabbing it seems to be recreated with new Instance ID
    I'm attaching the current project.

    If anyone understands what's happening, please, let me know. I'm encountering this bug on 5.6.0f3, but even after updating to latest 2017 version, it still happens
     

    Attached Files:

  2. BBIT-SOLUTIONS

    BBIT-SOLUTIONS

    Joined:
    Feb 21, 2013
    Posts:
    39
    Still having the same problem on Unity 2018.2.3. Did you find a solution?
     
  3. BBIT-SOLUTIONS

    BBIT-SOLUTIONS

    Joined:
    Feb 21, 2013
    Posts:
    39
    Do still not completely understand, why it happens, but found a workaround:

    You can simply check in a loop, if the assetId is valid and if not reassign it.

    Described it in more detail here.