I am able to spawn a network prefab and trigger the OnNetworkSpawn method override if I:
- select the prefab as player prefab in the Network Manager Properties screen
- invoke the NetworkManager.Singleton.StartHost() (or any method that initiates a client)
However, if I spawn the prefab by:
- not having the desired prefab selected as player prefab
- in script, getting NetworkObject component and call SpawnAsPlayerObject or SpawnWithOwnership
The prefab can still be spawned, but the spawned instances are not owned by any clients. Trying to print any of the NetworkBehaviour flags for the spawned prefab would result in false: IsOwner, IsOwnedByServer, IsClient, IsSpawned, IsServer.