Implementing bots in Fusion SharedMode

IWillMakeNameLater
edited January 2023 in Fusion

Hey, I have 2 questions about SharedMode in Fusion:

  1. How to detect master client switch, or moment when I become the new master client? I need to turn on navmesh agents for bots on new master client. My only idea is checking  Runner.IsSharedModeMasterClient every FixedUpdateNetwork().
  2. How to disable NetworkObject.DestroyWhenStateAutorityLeaves (set in editor) from code? I don't want bots to be automatically destroyed when MasterClient leaves.

Answers