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
With Distributed Authority topology if you spawn a NetworkObject with SpawnWithObservers = false and the property Ownership contains the flag Distributable, when a client later joins the session, that NetworkObject has a chance to be distributed to the new client (like all other distributable NetworkObject), but the object is never spawned on the new client.
The new client has authority over a NetworkObject that does not exist in its game, and for the other client that are Observers of this NetworkObject, the owner is the new client.
Reproduce Steps
Set Network Topology to Distributed Authority on the NetworkManager
Add the flag Distributable to the Ownership of the NetworkObject
Spawn the object with this code.
networkObject.SpawnWithObservers=false;// in DA, if SpawnWithObservers is false, the owner of the NetworkObject will be the only one added to Observers listnetworkObject.Spawn();
Actual Outcome
The owner of NetworkObject becomes the new client, but that client doesn't even know that it owns that NetworkObject.
Expected Outcome
NetworkObject should not be distributed to the client who does not see it.
Environment
OS: Windows 11
Unity Version: 6000.0.32f1
Netcode Version: 2.2.0
The text was updated successfully, but these errors were encountered:
…3323)
<!-- Replace this block with what this PR does and why. Describe what
you'd like reviewers to know, how you applied the engineering
principles, and any interesting tradeoffs made. Delete bullet points
below that don't apply, and update the changelog section as appropriate.
-->
<!-- Add short version of the JIRA ticket to the PR title (e.g. "feat:
new shiny feature [MTT-123]") -->
[MTTB-1041](https://jira.unity3d.com/browse/MTTB-1041)
<!-- Add RFC link here if applicable. -->
## Changelog
- Fixed: ChangeOwnership should never distribute to a client that is not
an observer of that object.
## Testing and Documentation
- No tests have been added.
<!-- Uncomment and mark items off with a * if this PR deprecates any
API:
### Deprecated API
- [ ] An `[Obsolete]` attribute was added along with a `(RemovedAfter
yyyy-mm-dd)` entry.
- [ ] An [api updater] was added.
- [ ] Deprecation of the API is explained in the CHANGELOG.
- [ ] The users can understand why this API was removed and what they
should use instead.
-->
Closes#3299
Description
With Distributed Authority topology if you spawn a
NetworkObject
with SpawnWithObservers = false and the property Ownership contains the flag Distributable, when a client later joins the session, thatNetworkObject
has a chance to be distributed to the new client (like all other distributable NetworkObject), but the object is never spawned on the new client.The new client has authority over a
NetworkObject
that does not exist in its game, and for the other client that are Observers of thisNetworkObject
, the owner is the new client.Reproduce Steps
NetworkManager
NetworkObject
Actual Outcome
The owner of
NetworkObject
becomes the new client, but that client doesn't even know that it owns thatNetworkObject
.Expected Outcome
NetworkObject
should not be distributed to the client who does not see it.Environment
The text was updated successfully, but these errors were encountered: