- Home /
Spawning the right prefab with Network.Instantiate
Hi All,
Hopefully this will be a simple one.
Within my OnConnectedToServer function I use Network.Instantiate. At that point in time I cannot use NetworkView.isMine, so I have a network config component attached to the prefab where I can use the isMine test. The network config component goes through various components and turns them on and off and switches various settings within other components.
That is all fine, but as my prefab has a growing number of components attached to it, its becoming a bit of a chore to update the network config component. I am thinking it would be much easier if I have a 'localPlayer' and 'remotePlayer' version of the prefab so I can just go in and adjust them independently.
The problem is I have no idea how I can choose to instantiate one over the other within the OnConnectedToNetwork callback.
Does anyone have any ideas on best approaches to this?
Thanks
Mike.