com.unity.netcode.gameobjects icon indicating copy to clipboard operation
com.unity.netcode.gameobjects copied to clipboard

Permanently disable "Add NetworkObject Prompt" (Breaks Dynamically spawned Prefabs with nested Prefabs)

Open AlexEnnerfelt opened this issue 1 year ago • 1 comments

Feedback Users should have the option to completely disable the "Add NetworkObject" prompt. I understand that this solves a lot of issues for users, but in some fairly common cases this will be infuriating and even break the project.

Scenario: Nested Prefabs

  • You have a prefab "Parent" with NetworkObject attached
  • You have a prefab "Child" with NetworkBehaviour attached and NO NetworkObject
  • You add "Child" to "Parent" prefab

Every time you select "Child" you will get the "Add NetworkObject" prompt, and there is no way to prevent it from continuously prompting this. If you accidentally click "Yes", or worse "Yes (Do not show me this message again on this machine)" a NetworkObject will be added to the "Child".

If "Parent" is a dynamically spawned prefab, it will not spawn because nested NetworkObjects is NOT supported for dynamically spawned objects.

If you accidentally click "Yes (Do not show me this message again on this machine)" at any point on your machine. This will break any project you have with nested prefabs.

I had the experience of having to go through all of my prefabs and remove the NetworkObject for the nested prefabs and also deal with the prompt appearing multiple times per prefab upon removal. For large projects (like mine) this can take hours.

Suggested Changes Add a setting to Project Settings (it should be project scoped since some projects might not make use of nested prefabs that are dynamically spawned) that completely disables the prompt. Perhaps even add a checkbox to the prompt like a "Do not show this again"

AlexEnnerfelt avatar Jul 01 '24 05:07 AlexEnnerfelt

Adding this to v2.0.0 since it is in pre-release. Will need to get approval to back-port this to v1.x.

NoelStephensUnity avatar Aug 25 '24 20:08 NoelStephensUnity