Ok, I’m a bit confused. I’m manually adding a networkView to a GameObject and allocating an ID. But for some reason it isn’t showing that it is mine.
My challenge is I have a game which can be played single player, but other players can potentially join later. So I’m executing the following code when there may not be an established network connection - I was rather hoping it would work while I was single player and then I’d suitably change IDs as players connected. But the networkView.viewID says it isn’t mine, although I allocate it and have instantiated the object myself (not with Network.Instantiate though - I’m going down the RPC route).
Here’s my code:
void Start()
{
gameObject.AddComponent<NetworkView>();
networkView.stateSynchronization = NetworkStateSynchronization.Off;
networkView.observed = null;
networkView.viewID = Network.AllocateViewID();
Debug.Log(networkView.isMine.ToString()); //Always false
}
After that code the network view says it isn’t mine.