Search Unity

Advertisement NullReferenceException

Discussion in 'Unity Ads & User Acquisition' started by Dracolyte, Feb 1, 2021.

  1. Dracolyte

    Dracolyte

    Joined:
    Dec 1, 2019
    Posts:
    4
    I try to make rewards for watching ads. It works if i start the game and stay in the main menu scene. But if i go to the game scene and then back to the main menu scene and press the button to watch the ad and get the reward, i get this: NullReferenceException: Object reference not set to an instance of an object AdManager.OnUnityAdsDidFinish (System.String placementId, UnityEngine.Advertisements.ShowResult showResult) (at Assets/Scripts/AdManager.cs:166) UnityEngine.Advertisements.Platform.Platform+<>c_DisplayClass41_0.b_0 () (at Library/PackageCache/com.unity.ads@3.6.1/Runtime/Advertisement/Platform/Platform.cs:171) UnityEngine.Advertisements.Utilities.CoroutineExecutor.Update () (at Library/PackageCache/com.unity.ads@3.6.1/Runtime/Advertisement/Utilities/CoroutineExecutor.cs:17)

    I know how to fix these simple NullReferenceExeptions, but i cant do something without help in this one.. Please help me guys
     
  2. Unity_Adamski

    Unity_Adamski

    Unity Technologies

    Joined:
    Jul 20, 2020
    Posts:
    110
    Hi, would you be able to share your AdManager script for me please?