https://docs.unity3d.com/2022.1/Documentation/ScriptReference/MonoBehaviour.OnApplicationFocus.html Unity - Scripting API: MonoBehaviour.OnApplicationFocus(bool) OnApplicationFocus is called when the application loses or gains focus. Alt-tabbing or Cmd-tabbing can take focus away from the Unity application to another desktop application. This causes the GameObjects to receive an OnApplicationFoc..