Hello everybody! hope you all doing good. So recenlty I started working with ads. However, I can't really get them to work. I just want a simple BOX/IMAGE WITH COLLIDER OR 2D SPRITE when you touch it, an AD will display. That's all. however it's not working. My game is android and this is my script. Does the OnMouseDown not work with android touch? and when I tried it. It does work, however it's very buggy (sometimes it works, sometimes not and then it stops working) What I have here is a simple box collider and this script. Thanks guys! Code (CSharp): using UnityEngine; using System.Collections; using UnityEngine.Advertisements; public class Touch2 : MonoBehaviour { // Use this for initialization void Start () { } // Update is called once per frame void OnMouseDown() { //now your gameObject was clicked! Advertisement.Initialize ("57898"); if(Advertisement.isReady()){ Advertisement.Show(); } } } I also tried other codes I made. Sometimes it works, sometimes not and getting really frustrated here, any help would be nice
On the box collider of a gameobject which is just a box with collider. I am sure it's something like that, but it's not working. Doesn't void OnMouseDown() { work on mobile device android too?
Is there by any chance a limit on how many times you can click on an ad? I mean, I just tweaked it a bit and for the first time, it working but however about 3 clicks and watching the ads, then it won't work. Even re-installing it won't work. Just a blank click.
Initialize should only be called in Awake/Start, not every time. Put your game into test mode at Monetization Settings > Advanced on the website. There's some type of limit to live ads per day per user, but no limit to test ads.
Thanks Stardog, I changed the ads to test mode and it asked me for the "Advertising ID of the device" and I left that blank. I tested it now on my mobile, unfortunately it's not working. Same problem nothing is happening. (Also tried them with all off and all on, still nothing.) PS: The thing is, testing it on unity works fine. The ads says there working on the first click. However, on mobile they are not showing up. They only worked once for about 1-3 times after I put the game over 10 times into my mobile for testing after that won't work again.