machine id怎么查 not found怎么办

扫一扫关注官方微信How can the &View ID AllocatedID: X not found during lookup. Strange behaviour may occur& error be ignored ? - Unity Answers
Navigation
Unity account
You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio.
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 :)
To ignore errors is never a good solution. Try to avoid it. You can use
on the NetworkView on the server to enable/disable updates for a specific user.
You may also have a look at
There is a
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.
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);
(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.
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!
Hint: You can notify a user about this post by typing @username
Attachments: Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
4 People are following this question.

我要回帖

更多关于 machine id 的文章

 

随机推荐