Unity video ads work until I reload scene.

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

It seems that I have and object Placeholder that is destroyed and not created on SceneManager.LoadScene. Does anyone know how to fix it?

Window → Package Manager → Advertisement to 3.4.1 seems to fix it

Thanks for reporting. I haven’t experienced problems with Ads SDK and scene loading. Which version did you use before upgrading?

Thanks,
Rasmus

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…

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.

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

3.4.0

SceneManager.LoadScene(“scenename”)

Im using unity 2019.2
Advertisements 3.41

Im going to post how I show de ad

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)

@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.

@sbankhead : This issue is happening for 3.4.1 and 3.4.2.

1 Like

@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

I tested version 3.4.4 and did not reproduce the problem. Could you provide the reproduce steps? Thanks.

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?

Could you provide the reproduce steps? Thanks.

Still happening with Advertisement 3.6.1 for me, on Unity 2019.4.17f1.

bump, i have this issue as well

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.

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.