Fusion
The whole answer can be found below.
Try Our
Documentation
Please check if you can find an answer in our extensive documentation on Fusion.
Join Us
on Discord
Meet and talk to our staff and the entire Photon-Community via Discord.
Read More on
Stack Overflow
Find more information on Stack Overflow (for Circle members only).
Fusion: OnOwnershipRequest equivalent?
mertb
2022-06-07 01:06:16
Hello all,
In PUN, I could implement IPunOwnershipCallbacks
and add some complex logic to OnOwnershipRequest
to determine if the ownership can be transferred. From there, targetView.TransferOwnership()
did the trick.
However, I'm having trouble finding the equivalent of this in Fusion. It seems like NetworkObject.StateAuthority
only allows authority transfer if the object doesn't already have an authority. It doesn't seem to expose any functionality to let the user implement custom logic to determine if the transfer should occur or not. Am I missing something?
Thank you all in advance.
Comments
Hi @mertb ,
It will depend on which mode you are using:
- ClientServer Mode: the Server is always the state authority, and it can't be transferred.
Shared Mode: there is a toggle named Allow State Authority Override
on the NetworkObject
- component that allows another Player to get State Authority over it without the current State Auth Player allowing it. If this is disabled, then the Player needs to release the Authority first. Yes, at the moment there is not a way to implement a check as you described, but what you can do is just have this option disabled, and only release the Authority based on any custom logic you have, so another Player can pick it up from there.
--
Ramon Melo
Photon Fusion Team
Back to top