Illegal view ID
The whole answer can be found below.
Try Our
Documentation
Please check if you can find an answer in our extensive documentation on Realtime.
Join Us
on Discord
Meet and talk to our staff and the entire Photon-Community via Discord.
Read More on
Stack Overflow
Find more information on Stack Overflow (for Circle members only).
Illegal view ID:0 method: LoadPlayer GO:Networking Manager
Shadowing
2017-04-28 13:18:03
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)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
Comments
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.
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.
sweet Thanks Tobias.
That fixed my issue.
I would of never of guessed that was the issue lol.
Hehe. Means I have to work on the error messages ;)
Glad we could solve this!
Hi @Shadowing and @Tobias can you please explain how did you assign photon view Id manually. I am also facing the same issue.
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.
Seth01Master
2022-11-13 23:08:12
I am getting the same problem with my code, but I am using PhotonNetwork.Instantiate(). Any help?
Please create a new Thread with the full callstack for your problem.
And please use the PUN category of this forum.
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);
Back to top