Unity Ads Stopped Working

Hi,
From this week I’ve started having issues with Unity Ad’s. They’re no longer playing in test mode in either the computer on test devices.

Something kind of strange happens when I click play ad…

  public void ShowAd()
    {
        if (Advertisement.IsReady())
        {
            Advertisement.Show();
        }
    }

if I stop the game and look at the game mode I can see almost the silhouette for what the ad should be…
However if i click show ad just normally in the game I can’t see anything. It’s not until i stop the game that this comes up… The console returns

UnityAdsEditor: Show(, );
UnityEngine.Advertisements.Advertisement:Show()
UnityAdsExample:ShowAd() (at Assets/UnityAdsExample.cs:10)
UnityEngine.EventSystems.EventSystem:Update()

It sort of seems like it’s doing something. I just can’t see it.
To be clear, ad’s worked for quite some time. I went into Services / Unity ads and clicked around a little bit a few days ago… not sure if that messed anything up…

Steps I’ve taken;
I’ve tried removing all the ad packages with package uninstaller, from my understanding it’s all built into Unity now. I’m using 5.4.1f1…

i’ve tried installing Unity Ad’s 2.0 from the asset store (a werid step) - this caused issues with class double ups…

I’ve tried using simplified ads as well as my original code. Both produce very similar results in terms of a blank looking advertisment… This is my original code

 public IEnumerator ShowRewardedAd()
    {
        while (!Advertisement.IsReady())
        {
            Debug.Log("Advertisment is not ready");
            yield return new WaitForSeconds(0.1f);
        }

        Debug.Log("Advertisment is now ready");

        var options = new ShowOptions { resultCallback = HandleShowResult };
        Advertisement.Show("rewardedVideo", options);
        Debug.Log(Advertisement.isInitialized + " " + Advertisement.isShowing + " " + Advertisement.isSupported);

    }

    private void HandleShowResult(ShowResult result)
    {
        switch (result)
        {
            case ShowResult.Finished:
                Registry.instance.coinManager.AddCoins(100);
                break;
            case ShowResult.Skipped:
                Debug.Log("The ad was skipped before reaching the end.");
                break;
            case ShowResult.Failed:
                Debug.LogError("The ad failed to be shown.");
    
                break;
        }
        Registry.instance.gameStateController.ShowStatsPanel(false);
        Registry.instance.gameStateController.ShowMainMenu(true);


    }

Which outputs;

I feel like this all worked when I was using the original Unity ad’s but things haven’t migrated well.
If anyone has any hints or directions I’d love to hear it. I’m happy to provide anything further.

I realize this is quite verbose. Was trying to give as much info as possible. :slight_smile:

Hi,

The “silhouette” is a known issue, which happens if you exit playmode while the placeholder ad is shown in the editor. Otherwise I don’t know why you are not seeing any ads. Can you try to see if you can reproduce with our example integration project on GitHub - Unity-Technologies/unity-ads-engineintegration-test?

Thanks,
Rasmus

Hi Ramus,
Thanks very much for reply.
I grabbed your example and everything worked fine. I then made a new scene with a basic version of the ad’s and everything worked fine.

I went back to my game scene and it still didn’t appear on the screen. From what I can tell the ad isn’t visible. And i’m guessing that ad won’t play if it’s not being seen by the player.
Is there any chance i could of covered it over and it wasn’t playing?

My scene is setup with multiple camera’s… kind of a parralaxing deal I have going on,

I’m also using a canvas screen space camera to render the UI to…

Could these things be issues which stop the ad from playing? Or am I heading in the wrong direction…

I’m thinking about just loading up a scene to play the ad and then coming back… But i don’t know if that’s ideal… Not to sure if you have any more ideas about this?

Sorry for delay, has been a busy week. Can you either see if you can recreate the issue with our example app, i.e. with setting up multiple cameras. Alternatively share your project with us, by creating a bug report using “Help->Report a bug…” menu item, and then post the bug id here?

(And if posting bug id, just the id, NOT the full url, especially not the one which included authentication info, which gives everyone with url access to the ticket including your project. Have seen that happening too many times, therefore this extra disclaimer…)

/Rasmus