Closed zachstronaut closed 7 months ago
It's also possible InitializeVariables()
or UpdateNetworkProperties()
are better candidates for the virtual
method?
This should not be an issue in v1.8.1 of NGO. NetworkTransform no longer uses named messages.
Thanks, that does seem to be the case!
NetworkTransform
'sTeleport()
method will throw a string exception if you try to use it before thatNetworkTransform
'sOnNetworkSpawn()
has completed, which means that any other code that waits forOnNetworkSpawn()
in the user codebase that wants toGetComponent<NetworkTransform>()
andTeleport()
the object has a potential race condition withNetworkTransform
.The source of the error is
m_MessageName
not being set yet. This however shouldn't be done inOnNetworkSpawn()
. This sort of internal boostrapping by Netcode should be done in a pre-spawn step.NetworkBehaviour
has exactly such as concept:InternalOnNetworkSpawn()
.NetworkBehaviour
'sInternalOnNetworkSpawn()
should be made avirtual
method so that the following can be done inNetworkTransform
:Those lines would be removed from
NetworkTransform
'sOnNetworkSpawn()
.