Stop Whole game except one one object

Hello Devs, I want to know is there a script that can i do that ?

I wanna make a pause button;

When i press pause button, set Game’s Time.timeScale = 0;

When i do this whole game stops but i want to play animation of my pauseMenu object. So how can i do thet ?

Don’t use timeScale use a custom bool for pausing. For eg.

bool isPaused=false;
void Update()
{
if(!isPaused)
{
///your code here
}
}

use that variable in all places to pause. Except for the things which u don't want to be paused.