- Home /
How can the "View ID AllocatedID: X not found during lookup. Strange behaviour may occur" error be ignored ?
This exception is thrown whenever a networkview on one machine starts updating states and the network view on the other machine does not (yet) exist simply because the gameObject it is on is not activated (yet) and the gameObject in question is not created with Network.Instantiate, but it is already in the scene.
I want to bypass this error by simply ignoring it because when the networkView that is not found, gets finally activated on the machine that threw the exception, everything is all well and the states are updated correctly.
In other words, my question would be: Is there an elegant way to ignore this error say by using a try{}catch{} statement somewhere in the code, and if yes, where ?
This error is really a pain and in my case ignoring it solves the problem and should not be considered an error at all.
I am using for now a very non-elegant solution:
1. Initially the states synchronization is set to off
2. Only a few seconds after activation it is turned on (Unreliable or DeltaCompressed) to make sure the corresponding gameObject on the other machine has enough time to be activated by the time the server starts synchronizing states.
Additional note:
Network.Instantiate is not a valid solution for my problem since everything is already in the scene, plus instantiating prefabs at runtime creates a lot of undesired lag.
I hope I exposed the problem as clearly as possible and any help will be greatly appreciated :)
Paul
Hi, i have your same problem, have you solved this error? I dont understand how to fix that, can you answer me plz? =) Thanks in advance
Answer by Bunny83 · Feb 22, 2011 at 02:14 PM
To ignore errors is never a good solution. Try to avoid it. You can use SetScope on the NetworkView on the server to enable/disable updates for a specific user.
You may also have a look at Network.isMessageQueueRunning and Network.SetReceivingEnabled or Network.SetSendingEnabled
There is a level-loading-example that explains how you can use isMessageQueueRunning.
With groups you can group up specific things and disable the group if it should not be updated.
Answer by benni05 · Sep 26, 2012 at 02:13 PM
In my case the error was caused by a network instantiated game object whose NetworkView instance stemmed from a previous connection to a server. I got rid of it by destroying the game object and setting any references to null on the client.
Destroy(netSync.gameObject);
netSync = null;
(with netSync being the network instantiated game object)
Only then does another connection to a server not lead to this error message. This is because the NetworkView id that is complained about results from a previous connection.
Answer by CollosalChris · Jul 21, 2014 at 08:10 PM
Saw this issue by deleting a gameobject whose prefab had a networkView on it that was not really neaded, I had turned Network.Destroy into just Destroy but had forgotten to remove the networkView from the prefab! Ha ha, stupid me!
Answer by kimsjar · Dec 03, 2016 at 09:35 AM
if GameObject have NetworkView component, you must Network.Destroy.
Network.Instantiate, Network.Destroy is pair.
so you want only see yourself, then you don't need NetworkView Component.
but you want see all clients, then you need NetworkView and Network.Instantiate, Network.Destroy.
if you want Network.Destroy, then carefully consideration to networkview.isMine.
for example :
if(_networkview.isMine) Network.Destroy(gameObject);
Your answer
Follow this Question
Related Questions
Give a NetworkView a predetermined ID 0 Answers
Sending info to/from different networkViews 1 Answer
MultiPlayer - NetworkPlayer Event 2 Answers
Assigning the owner of networkviews manually 1 Answer
Network Instantiate with wrong owner. 2 Answers