Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Problem with Photon2 View when loading different scenes

Discussion in 'Scripting' started by Elisabeth123, Nov 13, 2019.

  1. Elisabeth123

    Elisabeth123

    Joined:
    Feb 17, 2016
    Posts:
    13
    Hi,
    I have the following problem: I have a game object with a script attach that handles all the logic for entering or leaving a room etc. This object should not get destroyed on load. Therefore I have a singleton that doesn't get destroyed on load. Now when I open another scene I often get the following error:

    Code (CSharp):
    1.  ThreadAbortException
    2. 11-13 13:46:45.958  2282   155 E Unity   :   at UnityEngine.Playables.PlayableDirector.SendOnPlayableDirectorStop () [0x00000] in <00000000000000000000000000000000>:0
    3. 11-13 13:46:45.958  2282   155 E Unity   :   at UnityEngine.GridLayout.DoNothing () [0x00000] in <00000000000000000000000000000000>:0
    4. 11-13 13:46:45.958  2282   155 E Unity   :   at UnityEngine.GridLayout.DoNothing () [0x00000] in <00000000000000000000000000000000>:0
    5. 11-13 13:46:45.958  2282   155 E Unity   :   at UnityEngine.GridLayout.DoNothing () [0x00000] in <00000000000000000000000000000000>:0
    6. 11-13 13:46:45.958  2282   155 E Unity   :   at UnityEngine.Playables.PlayableDirector.SendOnPlayableDirectorStop () [0x00000] in <00000000000000000000000000000000>:0
    7. 11-13 13:46:45.958  2282   155 E Unity   :   at UnityEngine.Playables.PlayableDirector.SendOnPlayableDirectorStop () [0x00000] in <00000000000000000000000000000000>:0
    8. 11-13 13:46:45.958  2282   155 E Unity   :   at UnityEngine.Playables.PlayableDirector.SendOnPlayableDirectorStop () [0x00000] in <00000000000000000000000000000000>:0
    9. 11-13 13:46:45.958  2282   155 E Unity   :   at System.Threading.Thread.SleepInternal (System.Int32 millisecondsTimeout) [0x00000] in <00000000000000000000000000000000>:0
    10. 11-13 13:46:45.958  2282   155 E Unity   :   at System.Threading.Thread.Sleep (System.Int32 millisecondsTimeout) [0x00000] in <00000000000000000000000000000000>:0
    11. 11-13 13:46:45.958  2282   155 E Unity   :   at LiveBoardDetection.BoardDetectionWorker () [0x00000] in <00000000000000000000000000000000>:0
    12. 11-13 13:46:45.958  2282   155 E Unity   :   at System.Threading.ThreadStart.Invoke () [0x00000] in <00000000000000000000000000000000>:0
    13. 11-13 13:46:45.958  2282   155 E Unity   :   at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00000] in <00000000000000000000000000000000>:0
    14. 11-13 13:46:45.958  2282   155 E Unity   :   at System.Threading.ContextCallback.Invoke (System.Object state) [0x00000] in <00000000000000000000000000000000>:0
    15. 11-13 13:46:45.958  2282   155 E Unity   :   at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <00000000000000000000000000000000>:0
    16. 11-13 13:46:45.958  2282   155 E Unity   :   at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <00000000000000000000000000000000>:0
    17. 11-13 13:46:45.958  2282   155 E Unity   :   at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x00000] in <00000000000000000000000000000000>:0
    18. 11-13 13:46:45.958  2282   155 E Unity   :   at System.Threading.ThreadHelper.ThreadStart () [0x00000] in <00000000000000000000000000000000>:0
    19. 11-13 13:46:45.958  2282   155 E Unity   :   at System.Threading.ThreadStart.Invoke () [0x00000] in <00000000000000000000000000000000>:0
    20. 11-13 13:46:45.958  2282   155 E Unity   :   at System.Linq.EnumerableSorter`1[TElement].CompareKeys (System.Int32 index1, System.Int32 index2) [0x00000] in <00000000000000000000000000000000>:0
    21. 11-13 13:46:45.958  2282   155 E Unity   :   at UnityEngine.GridLayout.DoNothing () [0x00000] in <00000000000000000000000000000000>:0
    22. 11-13 13:46:45.958  2282   155 E Unity   :   at UnityEngine.Playables.PlayableDirector.SendOnPlayableDirectorStop () [0x00000] in <00000000000000000000000000000000>:0
    23. 11-13 13:46:45.958  2282   155 E Unity   :   at UnityEngine.Playables.PlayableDirector.SendOnPlayableDirectorStop () [0x00000] in <00000000000000000000000000000000>:0
    24. 11-13 13:46:45.958  2282   155 E Unity   :   at UnityEngine.Playables.PlayableDirector.SendOnPlayableDirectorStop () [0x00000] in <00000000000000000000000000000000>:0
    25. 11-13 13:46:45.958  2282   155 E Unity   : System.Diagnostics.StackTrace:init_frames(Int32, Boolean)
    26. 11-13 13:46:45.958  2282   155 E Unity   : System.Diagnostics.StackTrace:.ctor(Int32, Boolean)
    27. 11-13 13:46:45.958  2282   155 E Unity   : UnityEngine.StackTraceUtility:ExtractStringFromExceptionInternal(Object, String&, String&)
    28. 11-13 13:46:45.958  2282   155 E Unity   : System.Linq.EnumerableSorter`1:CompareKeys(Int32, Int32)
    29. 11-13 13:46:45.958  2282   155 E Unity   : UnityEngine.GridLayout:DoNothing()
    30. 11-13 13:46:45.958  2282   155 E Unity   : UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
    31. 11-13 13:46:45.958  2282   155 E Unity   : UnityEngine.DebugLogHandler:LogException(Exception, Object)
    32. 11-13 13:46:45.958  2282   155 E Unity   : UnityEngine.Logger:LogException(Exception, Object)
    33. 11-13 13:46:45.958  2282   155 E Unity   : UnityEngine.Debug:LogException(Exception)
    34. 11-13 13:46:45.958  2282   155 E Unity   : UnityEngine.UnhandledExceptionHandler:<RegisterUECatcher>m__0(Object, UnhandledExceptionEventArgs)
    35. 11-13 13:46:45.958  2282   155 E Unity   : System.UnhandledExceptionEventHandler:Invoke(Object, UnhandledExceptionEventArgs)
    36. 11-13 13:46:45.958  2282   155 E Unity   : System.Linq.EnumerableSorter`1:CompareKeys(Int32, Int32)
    37. 11-13 13:46:45.958  2282   155 E Unity   : UnityEngine.GridLayout:DoNothing()
    38. 11-13 13:46:45.958  2282   155 E Unity   : UnityEngine.GridLayout:DoNothing()
    39. 11-13 13:46:45.958  2282   155 E Unity   : UnityEngine.GridLayout:DoNothing()
    40. 11-13 13:46:45.958  2282   155 E Unity   : UnityEngine.Playables.PlayableDirector:SendOnPlayableDirectorStop()
    41. 11-13 13:46:45.958  2282   155 E Unity   : UnityEngine.Playables.PlayableDirector:SendOnPlayableDirectorStop()
    42. 11-13 13:46:45.958  2282   155 E Unity   : UnityEngine.Playables.PlayableDirector:SendOnPlayableDirect
    43. 11-13 13:46:46.269  2282     1 E Unity   : PhotonView ID duplicate found: 1. New: View 1 on RoomController (scene) old: View 1 on RoomController (scene). Maybe one wasn't destroyed on scene load?! Check for 'DontDestroyOnLoad'. Destroying old entry, adding new.
    Can anyone help me with this problem?
    Thanks a lot,
    BR, Elisabeth