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

NetworkObject DANGER box message is highly confusing #1275

Closed
CodeSmile-0000011110110111 opened this issue Jun 9, 2024 · 2 comments · Fixed by #1316
Closed

NetworkObject DANGER box message is highly confusing #1275

CodeSmile-0000011110110111 opened this issue Jun 9, 2024 · 2 comments · Fixed by #1316
Assignees
Labels
Needs developer input Needs input from the development team to resolve type:bug Bug Report

Comments

@CodeSmile-0000011110110111
Copy link
Contributor

CodeSmile-0000011110110111 commented Jun 9, 2024

The NGO 2.0 manual page on NetworkObject has the following DANGER box with confusing statements:

DANGER
The order of networked objects matters. Make sure to load any NetworkBehaviour components before the Network Object component on the GameObject.

First sentence:
It mentions "networked objects". This might seem to refer to "networked GameObjects" but I think it actually means to say "NetworkBehaviour components" given the context switch to components in the second sentence.

Second sentence:
How are we supposed to "load" a NetworkBehaviour or any component for that matter?
The concept of "loading" a component does not exist in Unity. You can add a component, or you can change a component's script execution order.
If the latter was meant it should say so explicitly, because there is no other option to alter the component execution order.
The order of components in the Inspector does not affect the order in which these components run their lifecycle methods.

Lastly, why are we supposed to "load" the NetworkBehaviour components BEFORE the NetworkObject component?
Was this meant to say that NetworkObject must be the last component in the script execution order? I feel that would be backwards since it defaults to be at the top.

The DANGER box should also indicate what the expected failures might be (ie error messages, 1-frame delays, RPCs not sent/received) to make troubleshooting easier.

@PinoEire
Copy link

This danger box confuses me as well. I know that Unity loads the components from top to bottom (at least that is what it was; now I can't confirm this any longer on the docs). BUT the problem is that if I try to move the NetworkObject to the bottom of the game object, it refuses to do so, which is super confusing. Please clarify.

@jabbacakes jabbacakes added the Needs developer input Needs input from the development team to resolve label Jul 25, 2024
@jabbacakes jabbacakes mentioned this issue Jul 31, 2024
3 tasks
@jabbacakes jabbacakes linked a pull request Jul 31, 2024 that will close this issue
3 tasks
@jabbacakes jabbacakes self-assigned this Jul 31, 2024
@jabbacakes
Copy link
Collaborator

We've updated the info in this admonition box and turned it into a section on the page called 'Component order' with a lot more detail (see the linked PR). Hopefully that clears things up!

I'm gonna close this issue as completed, but feel free to reopen/leave more comments if the updates don't clear things up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs developer input Needs input from the development team to resolve type:bug Bug Report
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants