Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Prefabs using Photon Views get glitchedafter applying changes

Discussion in 'Prefabs' started by TokyoWarfareProject, Nov 8, 2018.

  1. TokyoWarfareProject

    TokyoWarfareProject

    Joined:
    Jun 20, 2018
    Posts:
    801
    Import a project using photon from 2018.2 everything will work fine, you can even do a build everything will work fine.

    How to break the project:
    Drag a prefab that uses photon, like player's prefab.
    Do nothing
    Apply all, apply all appears as the photon views get a view id.
    Next time you enter gameplay the prefab is glitched due to photon view id error.
    Project renders unusable.

    I'm uploading a reproduction project its the 2018.2 version so tester can see it running properly until it does the descrived operation.
    11h of upload ahead... rip.
     
  2. TokyoWarfareProject

    TokyoWarfareProject

    Joined:
    Jun 20, 2018
    Posts:
    801
    While people of Photon fixes this you cand avoid errors by doing so:

    Code (CSharp):
    1.  
    2.     void ResetViews()
    3.     {
    4.         PhotonView[] pvs = tank.GetComponentsInChildren<PhotonView>();
    5.         foreach (PhotonView p in pvs)
    6.         {
    7.             p.viewID = 0;
    8.         }
    9.     }
    Make an editor script call this on your objects with views, after that you can safely "apply all"

    edit: of course uniyt staff is welcome to build a fix to avoid it crashing as it does now :D
     
    Last edited: Nov 9, 2018
    LeonhardP likes this.