vrfpskit-docs
  • User Manual
    • Getting Started
    • Setup Troubleshooting
    • Damageable Component
    • XRHeldInputAction
  • Weapons
    • Included Weapons
      • Glock 17
      • HK-416 (AR-15)
      • AKS-74U
      • Winchester Model 1897
      • Mosin Nagant
      • HK Mp5
      • M67 Grenade
    • Firearm Components
      • Firearm
      • MagazineInteractor
      • CyclingFirearmAction
      • Input Components
        • FirearmTrigger
      • Physical Input Components
        • PhysicalUnlockActionTrigger
        • PhysicalFireSelectInteractor
        • MagazineCollisionDetacher
    • Creating Firearms
      • Animating the Firearm
  • Multiplayer
    • Authority Handling
    • Multiplayer Troubleshooting
    • Mirror Networking Docs
  • XR Interaction Toolkit Docs
  • Support Discord
Powered by GitBook
On this page
  1. Multiplayer

Authority Handling

Last updated 1 year ago

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.

XRMultiplayerInteractor also takes in to account nesting of interactors on interactables, allowing for structures like below.

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.

Nested interactors, automatically claimed by the XRMultiplayerInteractor when grabbed