Search Unity

Disable input when ad is playing

Discussion in 'Unity Ads & User Acquisition' started by Carson365, Jan 15, 2018.

  1. Carson365

    Carson365

    Joined:
    Nov 8, 2017
    Posts:
    42
    Hello!
    How can I disable player input when an ad is showing? When testing, if you press close on the ad, it starts my game automatically since to start the game, you click. Also when the test ad was playing, you could click things behind the ad, such as a button. Please help, thanks.
     
  2. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    The game should automatically pause when an ad is shown. Please share a screenshot in that case.

    Thanks,
    Rasmus
     
  3. Carson365

    Carson365

    Joined:
    Nov 8, 2017
    Posts:
    42
    What should I take a screenshot of?
    Pretty much you can click around the test ad and the game starts (which starts when you click). And with some testing, you can also move the player through the add.
    Have you ever heard of this happening before?

    Code:

    Code (CSharp):
    1.     public void ScoreMenuButton (string Main) {
    2.         if (Advertisement.IsReady ()) {
    3.             Advertisement.Show ();
    4.         }
    5.  
    6.         SceneManager.LoadScene ("Main");
    7.     }
    Besides that code, I also just have this at the top:

    Code (CSharp):
    1. using UnityEngine.Advertisements;
    Thanks.
     
  4. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    Are you running this in editor or on device?
     
  5. Carson365

    Carson365

    Joined:
    Nov 8, 2017
    Posts:
    42
    Editor.
    I want to test it on the device, but it wasn't working.
    I wasn't sure how to get to the Device Console an run the command :

    adb logcat -v time UnityAds:V *:S

    Thanks.
     
  6. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312