diff --git a/Assets/Mirror/Core/NetworkClient.cs b/Assets/Mirror/Core/NetworkClient.cs index 4ba9786cc..8a6f7ae76 100644 --- a/Assets/Mirror/Core/NetworkClient.cs +++ b/Assets/Mirror/Core/NetworkClient.cs @@ -1351,13 +1351,15 @@ internal static void ChangeOwner(NetworkIdentity identity, ChangeOwnerMessage me // used to happen in multiple places, so let's have this in one function. static void BootstrapIdentity(NetworkIdentity identity) { - identity.NotifyAuthority(); // calls OnStart/StopAuthority - - // initialize flags. - // after NotifyAuthority for compatibility with old behaviour. + // initialize flags before invoking callbacks. + // this way isClient/isLocalPlayer is correct during callbacks. + // fixes: https://github.com/MirrorNetworking/Mirror/issues/3362 identity.isClient = true; identity.isLocalPlayer = localPlayer == identity; + // invoke OnStartAuthority + identity.NotifyAuthority(); + // invoke OnStartClient identity.OnStartClient();