Skip to content

Remove the requirement and error message "NetworkManager cannot be nested"Β #2984

Open
@CodeSmile-0000011110110111

Description

Is your feature request related to a problem? Please describe.
When nesting the NetworkManager object in the scene, an editor script pops up a message box which says (shortened):

NetworkManager cannot be nested.
Click 'Auto-Fix' to automatically remove it from Global Objects or 'Manual-Fix' to fix it yourself in the hierarchy view.

Describe the solution you'd like
Make NetworkManager nestable, provided that the reason for doing so is mainly or solely because of DontDestroyOnLoad(..)

DontDestroyOnLoad can be applied to nested game objects simply by first unparenting the object, for example:

void Awake()
{
    transform.parent = null;
    DontDestroyOnLoad(gameObject);
}

Otherwise I would suggest improving the message box so that it mentions WHY it cannot be nested.

Additional context
I'm requesting this primarily because it feels overly restrictive to enforce a non-parenting NetworkManager and as a consequence, it feels like an outlier object because no other Unity component I've ever used had this particular restriction.

Other than the DDOL parenting reason above, which has a known and trivial solution, I could not think of any other reason why this is enforced. If there is another reason I'd like to hear about it though since I like to understand the rationale (which is absent from the message, which annoys me like any other "YOU CAN'T DO THIS" message or instruction without telling why).

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:featureNew feature, request or improvement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions