Quantcast
Channel: Questions in topic: "build"
Viewing all articles
Browse latest Browse all 4084

OnServerStart not working in Build. Works in editor

$
0
0
Unity 5.5.2f1 Build for Windows (.exe) I have a GameManager derived from NetworkBehavior that overrides OnStartServer: public class GameManager : NetworkBehaviour { static GameManager _manager = null; public static GameManager Instance { get { return _manager; } } ShipManager _shipManager; void Awake() { if (_manager == null) _manager = this; else if(_manager != this) Destroy(gameObject); DontDestroyOnLoad(gameObject); _shipManager = GetComponent(); } #region Overrides of NetworkBehaviour public override void OnStartServer() { base.OnStartServer(); Debug.Log("OnStartServer running"); _shipManager.LoadShips(); } #endregion } I run in the editor and select "Host", OnStartServer is called, all my ships are created, and everything seems to run fine. However, when I build and run in standalone, the OnStartServer function never runs and my ships are never created. Does anyone have any pointers? What am I missing here? Thanks.

Viewing all articles
Browse latest Browse all 4084

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>