I’m working on a game that has a mix of single player and multiplayer scenarios with different prefabs players can choose as their avatar in each. Because the prefabs need to work in single player situations, I can’t setup networking components on the prefabs themselves and I need the same prefab to work in both the single player and multiplayer scenarios.
What I’m currently trying to do is use a wrapper prefab with a NetworkIdentity for the players in the multiplayer scenarios that will instantiate the avatar prefab that player selected to use and set it up to work across the network. I’ve got the avatar prefabs instantiating everywhere correctly, but need to put a NetworkIdentity component on it so I can give it a NetworkTransform component. So my question is how do I add and setup a NetworkIdentity on a GameObject at run time so that I can use NetworkBehaviours on it? Is this possible or is there some other way I should go about this? Any help would be greatly appreciated, thanks!