• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Naxionman1978 · Jul 05, 2020 at 10:37 AM · unity ads

Unity Ads problem

I think I have checked every question concerning the subject, but I don't seem to find a similar one. I have a feeling that it must something simple I might have overlooked. The problem that I had unity ads set up very nicely - everything was working fine - but with the update of the Unity Ads SDK I was forced to change a few things. And now I have problems.

The problem is that when I click a certain button for a rewarded video, the testmode ad shows that everytinh is ok, but I can see in my console output that I have been rewarded not only for this ad, but also another one (from another scene)

What I have done so far:

I made a script for the initializing of the sdk just as shown in the guides

I have 3 placements (FreeGems, CoinDoubler, ResetTimer). 2 of them in the same scene (the main), and the CoinDoubler in another scene. When I test the game and press the button which triggers the CoinDoubler rewarded video, and eventually press "close" (to close the test ad) I get the Debug.Log lines: AdFinished: Player was rewarded 3 gems AdFinished: Player was rewarded double coins

And sometimes (I havn't found a steady pattern yet) it also shows this error:

MissingReferenceException: The object of type 'GameOver' 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.MonoBehaviour.StartCoroutine (System.Collections.IEnumerator routine) (at :0) GameOver.OnUnityAdsDidFinish (System.String myPlacementId, UnityEngine.Advertisements.ShowResult result) (at Assets/Scripts/Ingame/LevelManagers/GameOver.cs:284) UnityEngine.Advertisements.Platform.Platform+<>c_DisplayClass41_0.b_0 () (at Library/PackageCache/com.unity.ads@3.4.5/Runtime/Advertisement/Platform/Platform.cs:171) UnityEngine.Advertisements.Utilities.CoroutineExecutor.Update () (at Library/PackageCache/com.unity.ads@3.4.5/Runtime/Advertisement/Utilities/CoroutineExecutor.cs:17)

The GameOver script is the script where the ShowAd is called...

So...Each of the pieces of code that correspond to these ads are in totally differnent classes/scripts. If any piece of this code is needed to clarify the situation please tell me to attach it by editing this question.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Naxionman1978 · Jul 05, 2020 at 01:28 PM

How stupid of me...I hadn't included OnDestroy in my code...

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

130 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Unity Ads: Non-fullscreen ads? 1 Answer

Delete a project from unity services? 2 Answers

Unity Ads not working on my Android device but works on many other devices 1 Answer

unity unable to convert to dex format, need help fast. 0 Answers

Applovin error - MissingReferenceException: No parent activity specified 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges