Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Unity Rewarded and Interstitial Ads

how do i stop the time and music while an ad is playing or does unity handle that by itself?

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I found an old forum post about ads…

https://forum.unity.com/threads/how-do-i-pause-the-game-while-the-ads-are-showing.332757/

"When running your app on device, the Unity Player will pause while
Unity Ads are shown. However, if you are testing in the Unity Editor,
the game is not paused while the placeholder ads are shown.

You could handle this by pausing audio playback and setting the timescale to > 0 while showing. Then un-pause the audio and restore the timescale value
after the ad placeholder is closed."

So:

Time.timescale = 0;

and something like:

Camera.main.GetComponent<AudioSource>().Pause();

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading