Illegal view ID:0 method: LoadPlayer GO:Networking Manager

Options
Idk i can't seem to wipe this error out. Plus I get it twice when the scene loads for some reason. Everything works fine except I get this error in my log.

It only does it on this GameObject. I Instatiate other photonViews with no errors.
Its a prefab that gets Instantiated but not photonNetwork.Instatiated.

So thats the only difference. My other photonViews that don't give errors are characters in the game that are all PhotonNetwork.Instatiated.


Illegal view ID:0 method: LoadPlayer GO:Networking Manager
UnityEngine.Debug:LogError(Object)
NetworkingPeer:RPC(PhotonView, String, PhotonTargets, PhotonPlayer, Boolean, Object[]) (at Assets/Scripts/Third Party Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:3561)
PhotonNetwork:RPC(PhotonView, String, PhotonTargets, Boolean, Object[]) (at Assets/Scripts/Third Party Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonNetwork.cs:2892)
PhotonView:RPC(String, PhotonTargets, Object[]) (at Assets/Scripts/Third Party Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonView.cs:597)
c__Iterator0:MoveNext() (at Assets/Scripts/Random/SpawnPlayer.cs:139)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

Comments

  • Tobias
    Options
    > Its a prefab that gets Instantiated but not photonNetwork.Instatiated.

    Means you have a PhotonView on this GO but don't use our Instantiate() method?
    That's the explanation.
    Our Instantiate() variant makes sure the PhotonView is setup correctly, even before Awake() gets called on the new GO instance.

    You need to assign a viewID manually (in best case, the same on all clients in a room) or will get this error.
  • Shadowing
    Options
    Thanks man.
    Ahh ok i bet you are right then. Thats probably it. I think i am Instantiating a prefab that has photonView attached to it with out photon Instantiate. Infact I believe its exactly two prefabs which is why im getting two errors.
  • Shadowing
    Shadowing
    edited June 2017
    Options
    sweet Thanks Tobias.
    That fixed my issue.
    I would of never of guessed that was the issue lol.


  • Tobias
    Options
    Hehe. Means I have to work on the error messages ;)
    Glad we could solve this!
  • mariappan
    Options

    Hi @Shadowing and @Tobias can you please explain how did you assign photon view Id manually. I am also facing the same issue.

  • Tobias
    Options
    Compared to 2017 (which is when the last post was made in this thread), we've got way more info in the documentation. Have a look at "Manual Instantiation".

    ViewIDs are not used in the DotNet SDK, by the way. This would be a topic for the PUN subforum.
  • I am getting the same problem with my code, but I am using PhotonNetwork.Instantiate(). Any help?

  • Tobias
    Tobias admin
    edited November 2022
    Options

    Please create a new Thread with the full callstack for your problem.

    And please use the PUN category of this forum.

  • stubing
    stubing
    edited January 2023
    Options

    I ran into this same issue and here is how I fixed it without using photon to instantiate the GameObject


    before:

    photonView.RPC("SaveData", RpcTarget.All);

    -----------

    After:

    PhotonView photonView = PhotonView.Get(this);

    if (photonView.IsMine)

            photonView.RPC("SaveData", RpcTarget.All);