You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
NetworkBehaviors throw error message Mirror.NetworkTransformReliable on Spine requires a NetworkIdentity. Please add a NetworkIdentity component to Spine or it's parents. even though the game object has NetworkIdentity on it. Event though the error message is shown by OnValidate, everything still works. It's just the error message.
[IMPORTANT] How can we reproduce the issue, step by step:
Please tell us how to reproduce your issue, STEP BY STEP, with one of our built in examples.
-> Set the script execution order to run NetworkIdentity after NetworkTransformReliable
-> In any script attempt to create a Game Object on runtime
-> Add component NetworkTransformReliable first
-> Then after add component NetworkIdentity
var networkTransform = splitRootObj.AddComponent<NetworkTransformReliable>();
var networkIdentity = splitRootObj.AddComponent<NetworkIdentity>();
-> Run the code
-> NetworkTransformReliable triggers OnValidate and before the NetworkIdentity's Awake method which results in NetworkTransformReliable not having netIdentity and the error message to be shown.
On the other hand, if I move AddComponent<NetworkIdentity>() to be called first, I end up with a null reference thrown on every frame as the NetworkIdentity's Awake is triggering before NetworkTransformReliable is registered in NetworkBehaviours.
var networkIdentity = splitRootObj.AddComponent<NetworkIdentity>();
var networkTransform = splitRootObj.AddComponent<NetworkTransformReliable>();
Any bug that can be reproduced, can be fixed.
If we can't reproduce it, we can't fix.
Expected behavior
No errors to be shown.
Desktop (please complete the following information):
OS: MacOS
Build target: Editor
Unity version: 2022.3.25f1
Mirror branch: main
The text was updated successfully, but these errors were encountered:
Creating networked objects at runtime isn't supported, and we don't test for that or try to make that work, especially not with changing script execution order.
Object pooling, adding art from addressables at runtime, stuff like that. To spawn anything, client has to already have the prefab with the asset id that the server will send.
Bug report is not for discussion - join Discord for that.
Describe the bug
NetworkBehaviors throw error message
Mirror.NetworkTransformReliable on Spine requires a NetworkIdentity. Please add a NetworkIdentity component to Spine or it's parents.
even though the game object hasNetworkIdentity
on it. Event though the error message is shown byOnValidate
, everything still works. It's just the error message.[IMPORTANT] How can we reproduce the issue, step by step:
Please tell us how to reproduce your issue, STEP BY STEP, with one of our built in examples.
-> Set the script execution order to run
NetworkIdentity
afterNetworkTransformReliable
-> In any script attempt to create a Game Object on runtime
-> Add component
NetworkTransformReliable
first-> Then after add component
NetworkIdentity
-> Run the code
->
NetworkTransformReliable
triggersOnValidate
and before theNetworkIdentity
'sAwake
method which results inNetworkTransformReliable
not havingnetIdentity
and the error message to be shown.On the other hand, if I move
AddComponent<NetworkIdentity>()
to be called first, I end up with a null reference thrown on every frame as theNetworkIdentity
'sAwake
is triggering beforeNetworkTransformReliable
is registered inNetworkBehaviours
.Any bug that can be reproduced, can be fixed.
If we can't reproduce it, we can't fix.
Expected behavior
No errors to be shown.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: