I'm new in Unity. I'm in a trouble with pausing my game. I want when mouse is clicked anywhere of the game screen the game will be paused and clicking again will resume it.
I've tried this code
if(Input.GetMouseButton(0) && mychar.active == true)
if(Input.GetMouseButton(0) && mychar.active == false)
But it is not working as i supposed. The game is being paused when I press the left click , but when i released it resumes again !
How to get rid of this problem? Is there any other solution or any other function to pause and resume ?
Thanks in advance,