Search Unity

Unity video ads work until I reload scene.

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

Thread Status:
Not open for further replies.
  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

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    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:
    19
    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:
    97
    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:
    19
    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:
    97
    @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:
    22
    @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:
    626
    I tested version 3.4.4 and did not reproduce the problem. Could you provide the reproduce steps? Thanks.
     
  15. scarredthegame

    scarredthegame

    Joined:
    May 17, 2020
    Posts:
    1
    i have a similar issue with 3.4.5. I'm using a work around but i don't know how efficient that is in practice. Any idea how to overcome this?
     
  16. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    626
    Could you provide the reproduce steps? Thanks.
     
  17. thatindividualcontact

    thatindividualcontact

    Joined:
    Jan 30, 2021
    Posts:
    1
    Still happening with Advertisement 3.6.1 for me, on Unity 2019.4.17f1.
     
  18. Drowning-Monkeys

    Drowning-Monkeys

    Joined:
    Mar 6, 2013
    Posts:
    328
    bump, i have this issue as well
     
  19. Drowning-Monkeys

    Drowning-Monkeys

    Joined:
    Mar 6, 2013
    Posts:
    328
    What is happening is that when you stop playing, and then press play, the IsInitialized variable has somehow defaulted to true. The end result is nothing gets initialized, and the ad will never show.
     
  20. VimXSkywalker

    VimXSkywalker

    Joined:
    Feb 13, 2020
    Posts:
    3
    Same error here
    With Unity 2020.3.2f1 (LTS) and Unity Ads Package 3.7.1
    Note: My whole game is built in one scene and I am not de-activating the game object that is holding the AdsManager at anytime.
     
  21. VimXSkywalker

    VimXSkywalker

    Joined:
    Feb 13, 2020
    Posts:
    3
    I tried removing and adding the listener (Refreshing) but nothing worked
     
  22. sharpprogrammer2018

    sharpprogrammer2018

    Joined:
    Sep 1, 2018
    Posts:
    5
    same happening to me using latest versin
     
  23. sharpprogrammer2018

    sharpprogrammer2018

    Joined:
    Sep 1, 2018
    Posts:
    5
    amybody found the fix?
     
  24. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    The issue that sparked this thread was resolved in SDK 3.4.1.

    If you have an issue with the Ads SDK, please create a new thread and provide as much information as possible, including your SDK version, the Unity engine version, the behavior you are seeing, any error messages you receive, and any device logs you can get.
     
Thread Status:
Not open for further replies.