Search Unity

  1. New Unity Live Help updates. Check them out here!

    Dismiss Notice

Unity video ads work until I reload scene.

Discussion in 'Unity Ads' started by nunorbrito18, Jan 5, 2020.

  1. nunorbrito18

    nunorbrito18

    Joined:
    Dec 14, 2019
    Posts:
    12
    Hi. I have a button that plays one video ad. So far so good. If I press 10 times it works but when I reload the scene [SceneManager.LoadScene(...)] the banner ad is working as expected but the video ad it's not working and gives me this error:

    MissingReferenceException: The object of type 'GameObject' has been destroyed but you are still trying to access it.
    Your script should either check if it is null or you should not destroy the object.
    UnityEngine.Advertisements.Placeholder.HideSkipButton

    Unity 2019.3.0a6
     
    Last edited: Jan 5, 2020
  2. nunorbrito18

    nunorbrito18

    Joined:
    Dec 14, 2019
    Posts:
    12
    It seems that I have and object Placeholder that is destroyed and not created on SceneManager.LoadScene. Does anyone know how to fix it?
     
    Last edited: Jan 5, 2020
  3. nunorbrito18

    nunorbrito18

    Joined:
    Dec 14, 2019
    Posts:
    12
    Window -> Package Manager -> Advertisement to 3.4.1 seems to fix it
     
  4. rasmus-unity

    rasmus-unity

    Unity Technologies

    Joined:
    Aug 15, 2014
    Posts:
    1,225
    Thanks for reporting. I haven't experienced problems with Ads SDK and scene loading. Which version did you use before upgrading?

    Thanks,
    Rasmus
     
  5. AdXxRi123

    AdXxRi123

    Joined:
    Nov 8, 2018
    Posts:
    16
    Hello, Im having the same problem a have a Continue button that when you click it the game resumes when you had it, but I have reaload the scene it says the object is destroyed. I really need help with this, anyone knows how to fix it? I updated to Unity Ads 3.4.1 and no solution...
     
  6. sbankhead

    sbankhead

    Unity Technologies

    Joined:
    Jul 27, 2014
    Posts:
    52
    Can you explain how your reloading the scene? Are you using Application.Quit (which is inconsistent on different mobile devices) or loading a new scene? Any details such as, unity version, sdk version, a repro project, error logs, etc will help us troubleshoot your issue better. A sample script/project that can repro the issue is always appreciated.
     
  7. nunorbrito18

    nunorbrito18

    Joined:
    Dec 14, 2019
    Posts:
    12
    I updated the version of Advertisement to 3.4.1
    In the Unity:
    Window -> Package Manager -> Advertisement to 3.4.1 seems to fix it
     
  8. nunorbrito18

    nunorbrito18

    Joined:
    Dec 14, 2019
    Posts:
    12
    3.4.0
     
  9. AdXxRi123

    AdXxRi123

    Joined:
    Nov 8, 2018
    Posts:
    16
    SceneManager.LoadScene("scenename")

    Im using unity 2019.2
    Advertisements 3.41

    Im going to post how I show de ad
     
  10. MagiklyDelishis

    MagiklyDelishis

    Joined:
    Feb 20, 2017
    Posts:
    3
    The same issue is persisting for me. If I play the scene and reach the video it works fine, but if I get to the scene from another scene or restart the scene using SceneManager.LoadScene(“sceneName”); then I am met with an error:


    MissingReferenceException: The object of type 'GameObject' has been destroyed but you are still trying to access it.

    Your script should either check if it is null or you should not destroy the object.

    UnityEngine.Advertisements.Placeholder.ShowSkipButton (UnityEngine.GameObject canvasGameObject) (at <9b016cada4154af3a6f2148e9f5a0ea1>:0)

    UnityEngine.Advertisements.Placeholder.Show (System.String placementId, System.Boolean allowSkip) (at <9b016cada4154af3a6f2148e9f5a0ea1>:0)

    UnityEngine.Advertisements.Platform.Editor.EditorPlatform.Show (System.String placementId) (at <9b016cada4154af3a6f2148e9f5a0ea1>:0)

    UnityEngine.Advertisements.Platform.Platform.Show (System.String placementId, UnityEngine.Advertisements.ShowOptions showOptions) (at <9b016cada4154af3a6f2148e9f5a0ea1>:0)

    UnityEngine.Advertisements.Advertisement.Show (System.String placementId) (at <9b016cada4154af3a6f2148e9f5a0ea1>:0)

    AdController.ShowInterstitialIfReady () (at Assets/Scripts/AdController.cs:63)
     
  11. sbankhead

    sbankhead

    Unity Technologies

    Joined:
    Jul 27, 2014
    Posts:
    52
    @MagiklyDelishis Please update to 3.4.1 as this issues is a known issue in 3.4.0. If you have already update and are still seeing the issue, please start a new thread with the relevant details such as sdk version, editor version, device details, a repro script, etc.
     
  12. Gamezaur

    Gamezaur

    Joined:
    Oct 12, 2016
    Posts:
    17
    @sbankhead: This issue is happening for 3.4.1 and 3.4.2.
     
    Last edited: Feb 3, 2020
    snow2405 likes this.
  13. snow2405

    snow2405

    Joined:
    Oct 11, 2017
    Posts:
    2
    @sbankhead Same issue in 3.4.4 in the editor, after loading certain scenes over SceneManagment.Load the rewardVideo is not anymore able to show. Works if scenes are played in editor idividually. Not really sure how to fix this
     
  14. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    118
    I tested version 3.4.4 and did not reproduce the problem. Could you provide the reproduce steps? Thanks.
     
unityunity