- Home /
View ID AllocatedID: 150 not found during lookup. Strange behaviour may occur
Hi there,
Here is my problem: When I connect to the server the first time after the server is set up, everything is fine. But when I disconnect and connect again to the server the client receives two errors:
View ID AllocatedID: 150 not found during lookup. Strange behaviour may occur
Could't invoke RPC function 'AnimateEveryWhere' because the networkView 'AllocatedID: 150' doesn't exist
When the player disconnects, he cleans it up by:
void OnPlayerDisconnected(NetworkPlayer networkPlayer){
Network.DestroyPlayerObjects(networkPlayer);
Network.RemoveRPCs(networkPlayer);
}
Does anyone know the solution for this? Any help is appreciated!
It sounds like the server has sent a message (RPC) for an object which the client doesn't have. Are you perhaps not buffering some of your RPC calls for objects to be instantiated on the client? Some server debugging might be able to help you find out which object the RPC was intended for.
Does it matter if the client doesn't have the networkPlayer game object? Because this is the example in the unity scripting reference as well and if the player is disconnected it looks impossible to me that the client has got the network player.
Answer by tanuj0092 · Jun 03, 2014 at 10:38 PM
Every time you instantiate an object in a network, it's viewID is updated alongside. You must be using network.instantiate. That's why. The solution is to synchronize all other gameobjects too. try reinstantiating other objects in network too. I solved my similar problem this way.
Isn't it a bit weird to reinstantiate all the instantiated objects? Shouldn't there be a easier way to do this? I also tried Network.AllocateViewID but that didnt work for me either.
No, just instantiate only those objects which have networkView component on them. Not all of them. Try it! it will definitely work.
Your answer
![](https://koobas.hobune.stream/wayback/20220613144109im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
PhotonUnityNetworking UnityException 0 Answers
Distribute terrain in zones 3 Answers
c# set main camera to player (multiplayer) 1 Answer
Multiple Cars not working 1 Answer
UnityIAP? Assembly [...] will not be loaded due to errors: 0 Answers