Website responsiveness and Unity hogging the CPU

My web based Unity game is interacting with the website and encouraging the user to go back and forth between it and the webpage the game is embedded in.

When the game runs the webpage becomes generally sluggish, scrolling becomes jumpy, etc.
That is fine as long as the user is engaged with the game but interacting with the page is a pain.

I figured I can just stop/pause the game when it loses focus (OnApplicationFocus), but no matter what I try at that time, the webpage stays unresponsive.

I tried setting Time.timeScale to 0, Time.fixedDeltaTime to 0.2 or higher, Application.targetFrameRate to 2, disabled all the Cloth objects, etc.

Nothing will stop Unity from hogging all the resources.
Is there any way I can limit how much CPU Unity will use? I am fine with completely stopping the game, but I would like to keep the last rendered frame visible.

Thanks for any ideas!

Hey Matt,

That looks similiar.

Solution: Application.targetFrameRate

Didn’t know this existed, so thanks =).