-
Notifications
You must be signed in to change notification settings - Fork 437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OnNetworkSpawn() is not called with specific enter play mode options enabled/disabled. #1879
Comments
@pixldev With that in mind, the default settings for Unity are to have both domain and scene reloading enabled to assure that all of your classes are "reset back to the default state", the AssetDatabase is refreshed/updated, and then it reloads the scene, prior to serializing, in order to assure anything used by the scene is reloaded from the refreshed AssetDatabase. Netcode for GameObjects v1.0 currently is designed to work with domain and scene reloading enabled (i.e. it works with the default settings). While I can understand that if you have a really large scene it could save development/debugging iteration time by disabling the reloading of the scene, and as such I am going to mark this issue as a feature request. Before I do this, could you provide additional details as to why you would want either of the two options (domain or scene reloading) disabled and if it is blocking your project? (this will help the team determine the priority of this feature request) |
Having these settings disabled saves a lot of time. It is a nice-to-have, but rather low priority. A warning that these are unsupported could be handy. |
Description
OnNetworkSpawn()
is not called on NetworkBehaviours under these circumstances:OnNetworkSpawn
will not be called just for the first time after scripts reload.OnNetworkSpawn
will not be called at all.Reload Scene and Reload Domain are under the enter play mode settings in Projects Settings > Editor.
Reproduce Steps
Actual Outcome
The message "OnNetworkSpawn() called" doesn't appear due to
OnNetworkSpawn()
not being called. If you disabled both Reload Scene and Reload Domain, the message will appear if you enter mode again without reloading scripts. If you disabled just the Reload Scene the message won't appear at all.Expected Outcome
The message should appear in the console window.
Environment
The text was updated successfully, but these errors were encountered: