Illegal view ID:-999 method:

Options
I created & instantiate prefab with Photon View attached on it.
While creating Group i will instantiate prefab it sets view ID of -999.

Proceeding with that ViewID shows an following error:

Illegal view ID:-999 method: sendMessageToServer GO:Communicator(Clone)
UnityEngine.Debug:LogError(Object)
NetworkingPeer:RPC(PhotonView, String, PhotonTargets, Object[]) (at Assets/Plugins/PhotonNetwork/NetworkingPeer.cs:2629)

Comments

  • Tobias
    Options
    This seems to be related to being player ID -1. It's a bug Carmine ran into before but I still could use a reproduction case to fix this.
    Is that in Offline Mode?
  • SaravanaKumar
    Options
    Is that you are asking Host Type?
    Host Type is set as Photon Cloud.

    I am Beginner for this Multilayer networking concept and totally confusing in the implementation of PUN into my project.

    In Workers Demo By Giving join room will directly enters into Game scene. But in my case it will be similar to the game 'Battle monkeys' .

    Host/Server: Created Room and waits for Clients to Connect.(At this time List of Player only contains Host name.)
    Client : Joined to the particular room. and waits for host to starts play.(After client joined into the Server. Host and client details displayed in list. But, How could i send this details into server to update its list. )

    I am stuck in this part.



    Help to solve this?????
  • SaravanaKumar
    Options
    @Tobias

    Can you tell me why PhotonViewId is moving to Negative like(-999)????
    I still getting this error. . .
  • Tobias
    Options
    See above: I need a reproduction project to be able to find the cause.
    I don't see how this can happen, except when you are allocating views while you're not yet in a room.
  • Blueeyesjt1
    Options
    Tobias said:

    See above: I need a reproduction project to be able to find the cause.

    I don't see how this can happen, except when you are allocating views while you're not yet in a room.

    I'm seeming to be having the same problem, 6 years later! I made a forum post about it. Need some help too! Thanks.
  • blanx
    Options
    Is there any help to this?
    I got the same problem. As soon as I Initiate prefabs with Photon Views, I'm getting ID's like this. (-999, -998 etc.)
  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @blanx,

    Thank you for choosing Photon!

    What PUN version are you using?

    As @Tobias already hinted:

    Each newly assigned PhotonView ID is calculated from the actor number (player ID) in the room and MAX_VIEW_ID and view IDs counter per actor.
    So -999 is calculated from: -1 (actor number) * 1000 (MAX_VIEW_ID) + 1 (first view ID for this actor).
    The issue is in the actor number which should be > 0.

    As long as we don't have minimal repro steps we can only guess and give pointers/hints.

    Actor number is -1 when you are not joined to an online room.
    So if you are not in offline mode, make sure to try to instantiate network prefabs w/ PhotonView too early.
    Wait until the client is actually joined to a room (OnJoinedRoom callback).
  • blanx
    Options
    Hey @JohnTube

    Thanks for the response, that was actually the answer. My Prefabs were Initiated before I joined a room.
    Making my Start() a IEnumerator fixed it.

    This I my solution for everyone who needs it:
    private IEnumerator Start()
    {
            yield return new WaitUntil(() => PhotonNetwork.InRoom);
            GameObject go = PhotonNetwork.Instantiate(......);
    }