I'm trying to find the best approach to controlling the spawn process in a multiplayer unity game.
Having looked over the docs, I have a NetworkManager and it's easy enough to set a player prefab and some other registered prefabs.
What I need to do, it randomly pick the prefab that the player spawns as (from a predefined set).
Having looked over the docs and tutorials I have found two potential options but have not managed to implement either.
a) Override the network manager and provide an implementation of
OnServerAddPlayer as per this page: https://docs.unity3d.com/ScriptReference/Networking.NetworkManager.OnServerAddPlayer.html
- With this approach I'm not sure how to attach my overridden network manager class to the scene. Do i add it as a component to the NetworkManager? Do I remove the network manage and use this script instead?
b) Provide a spawn manager class as per this page: http://docs.unity3d.com/Manual/UNetCustomSpawning.html
- With this approach I'm also unsure how to attach the spawn manager to the rest of the scene. I've tried adding it in the hierachy within an empty game object, but I'm unsure then how to make use of it within my NetworkManager. The docs only give examples of using it to control bullets being created programmatically.
Afraid I'm quite new to unity and just trying to get to grips with the basics. Would really appreciate some pointers on this one.