Android Help - How to suspend the game during a phone call?

I was play testing my game and had my wife call me. After pressing the “Answer” button to answer the call about 10 times with no results, all of a sudden it finally answered the call. When I ended the call with the “End Call” button, my game was back on the main menu… There is nothing in my code that would make that happen. (If I had failed the level, I should’ve at least seen the “Game Over” screen).

So how can I properly suspend the game when I receive an incoming call and pickup exactly where I left off when the call is ended? Or even better, when the call is ended, make the player click a ‘Resume’ button (it’s an action game so better make sure they are ready!)

In your player settings, make sure that “run in background” is not set.

Unity will call OnApplicationPause() on all of your MonoBehaviours when the player is paused (for example, by receiving a phone call). You could use this to bring up a pause menu.