chore: Better NetworkBehaviour index out of range message#2295
chore: Better NetworkBehaviour index out of range message#2295JesseOlmer merged 6 commits intodevelopfrom
Conversation
Changes the error message to be more easily actionable for users
| if (NetworkLog.CurrentLogLevel <= LogLevel.Error) | ||
| { | ||
| NetworkLog.LogError($"Behaviour index was out of bounds. Did you mess up the order of your {nameof(NetworkBehaviour)}s?"); | ||
| NetworkLog.LogError($"NetworkBehaviour index was out of bounds for {name}. NetworkBehaviours must be the same, and in the same order, between server and client."); |
There was a problem hiding this comment.
Can we replace both 'NetworkBehaviour' with '{nameof(NetworkBehaviour)}'
There was a problem hiding this comment.
Also perhaps
NetworkBehaviours must be the same => NetworkBehaviours must have the same components
There was a problem hiding this comment.
Made the nameof change. Did not make the wording change - NetworkBehaviours ARE components, they don't contain components. Perhaps you meant NetworkObject? But I'd still rather not make that change because it's really not accurate either. This is a relatively complicated situation and a long error message feels unwarranted here.
In case you're curious, the word-salad criteria is:
"All NetworkBehaviours on an object containing a NetworkObject component, including child objects, but only those which don't have their own NetworkObject component, must match exactly in their number, as well as type and order (although neither are checked in this case)."
… chore/better-nbindex-error
…nologies#2295) Changes the error message to be more easily actionable for users Co-authored-by: Noel Stephens <noel.stephens@unity3d.com>
Changes the error message to be more easily actionable for users
Changelog
Testing and Documentation