Skip to content
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

Docs Bug - Conflicting Info Regarding NetworkObject Parenting #1350

Open
jackdaus-at-noblis opened this issue Sep 23, 2024 · 0 comments
Open
Labels
type:bug Bug Report

Comments

@jackdaus-at-noblis
Copy link

jackdaus-at-noblis commented Sep 23, 2024

Describe the bug:
This isn't a runtime bug, but more of docs "bug" :).

There is conflicting information in the docs regarding NetworkObject Parenting. These two statements (i) and (ii) seem to conflict with each other. In addition, statements (i) and (ii) seem to conflict with statement (iii)

(i) Can Nest both In-Scene and Dynamically Spawned NetworkObjects

  • You can perform the same parenting actions with in-scene placed NetworkObjects as you can with dynamically spawned NetworkObject components.
  • Unlike network prefabs that don't allow in-Editor nested NetworkObject component children, in-scene placed NetworkObjects can have multiple generations of in-editor nested NetworkObject component children.
  • You can parent dynamically spawned NetworkObject components under in-scene placed NetworkObject components and vice versa.

and

(ii) Can Only Nest Dynamically Spawned NetworkObjects (and not In-Scene NetworkObjects)

Only spawned NetworkObjects can be parented
A NetworkObject component can only be parented if it's spawned and can only be parented under another spawned NetworkObject component. This also means that NetworkObject component parenting can only occur during a network session (netcode enabled game session).

and

(iii) Can Only Nest In-Scene NetworkObjects (and not Dynamically Spawned NetworkObjects)

Before detailing Boss Room's approach to NetworkObject parenting, it's important to highlight a limitation of Netcode: A dynamically-spawned NetworkObject can't contain another NetworkObject in its hierarchy. If you spawn such a NetworkObject, you can't spawn children NetworkObjects. You can only add children NetworkObject components to a NetworkObject that is part of a scene.

These three statements seem to contradict. (Or maybe I am just misunderstanding something here!) I understand these statements to mean,

  • (i) I can parent two NetworkObjects during design time in the Unity editor.
  • (ii) I cannot parent two NetworkObjects during design time in the Unity editor, and instead I must perform the parenting during a network session.
  • (iii) I cannot parent NetworkObjects during a network session, and instead I must do it during design time in the Unity Editor.
@jackdaus-at-noblis jackdaus-at-noblis added the type:bug Bug Report label Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Bug Report
Projects
None yet
Development

No branches or pull requests

1 participant