Authority Handling
Last updated
Last updated
Network Authority is handled automatically by the XRMultiplayerInteractor component that takes in to account whether a player is holding an object or not. XRMultiplayerInteractor Component should be applied to your player prefab, and will handle all interactors in children.
VRFPS Kit uses a customized solution of Mirror. This means that the Sync Direction of a network behaviour can be changed at runtime, making it possible for it to be both server and client authoritative. Normally, using Mirror's NetworkIdentity.isOwned
& NetworkIdentity.isServer
is usually enough to determine ownership of an object.
However, we've wrote a helper function that can determine both client authority & server authority of a NetworkBehaviour directly, namely the XRMultiplayerInteractor.HasBehaviourAuthority()
method. This is especially useful when you are writing code that needs to run both on client & server authority.