[1258] OnOwnershipTransferred does not fire at OnPlayerLeft if last owner is passive change
complete
LefTonbo
OnOwnershipTransferred()
does not fire at OnPlayerLeft()
if last owner is passive change.It only fires if SetOwner() is used after OnOwnershipTransferred().
This can break some behabiour such as owner change detection.
Reproduction:
- Create an Udon that implements event detection (such as printing to UI.Text) at OnOwnershipTransferred()andOnPlayerLeft().
- Put the Udon to object.
- Do Build & Testand run 2 or more clients.
- After every clients are in the instance, close one client that is current object owner.
- Observe the result.
Expected results: Leaving the current owner fires
OnOwnershipTransferred()
on other clients so the clients can detect owner changing.Actual results: Leaving the current owner does not fire
OnOwnershipTransferred()
on other clients, and its owner is silently changed.---
Picture 1: Event log by the joining player. The last owner leaves after getting the owner with SetOwner. The event is fired to the joining player.
Picture 2: Event log by the joining player. The last owner leaves without using SetOwner. The event is not fired for the joining player.
---
Build: 1258
SDK World: 3.1.10
Log In
Fax
complete
This should be fixed in version 2023.2.1, build 1295! 🎉
OnOwnershipTransferred
now fires when master client leavesPlease let us know if you continue experiencing any issues. Thank you for your report, we appreciate your help!
Fax
Merged in a post:
OnOwnershipTransferred should fire when the object owner leaves the instance, as well as when ownership changes players.
Whaddageek
A player leaving the world is a valid case of ownership for a networked object changing, and should thus trigger OnOwnershipTransferred as a result. This feels like either a bug or an odd design choice to make, as it's an esoteric case that should be standardize by this endpoint.
Phasedragon
tracked bug
LefTonbo
Additional note: "passive change" means changing the object owner by not using
SetOwner()
, such as changing the object owner to Master by leaving last owner from the instance. Becoming the first object owner will also considered as "passive change".Example 1:
- Player A joins the instance. It becomes the first object owner ("passive change").
- Player B joins the instance.
- Player A leaves the instance. This causes changing the object owner to Player B ("passive change") It will NOT fire OnOwnershipTransferred()because last owner is "passive change".
Example 2:
- Player A joins the instance. It becomes the first object owner ("passive change").
- Player B joins the instance.
- Player B takes its object owner by using SetOwner()(NOT "passive change"). It firesOnOwnershipTransferred().
- Player B leaves the instance. This causes changing the object owner to Player A ("passive change"). It will fire OnOwnershipTransferred()because last owner is NOT "passive change".
- Player C joins the instance.
- Player A leaves the instance. This causes changing the object owner to Player C ("passive change") It will NOT fire OnOwnershipTransferred()because last owner is "passive change".