Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

only showing test ad?

Discussion in 'Unity Ads & User Acquisition' started by JDVDeisgn, Jan 27, 2016.

  1. JDVDeisgn

    JDVDeisgn

    Joined:
    Oct 17, 2015
    Posts:
    148
    I initialise the add with my number and everything, however, it only shows the test ad. Why is this? This is how I'm doing it:

    Code (CSharp):
    1. using UnityEngine.Advertisements;
    2.  
    3. void Start () {
    4.  
    5. Advertisement.Initialize ("1028885", true);
    6.  
    7. }
    8.  
    9. void Update () {
    10.  
    11. if (ballsleft.ballsleftv == 0f) {
    12.  
    13.             Advertisement.IsReady ();
    14.            
    15.             Advertisement.Show ();
    16.  
    17. }
    18. }
    if someone could help me out, thanks
     
  2. rasmus-unity

    rasmus-unity

    Unity Technologies

    Joined:
    Aug 15, 2014
    Posts:
    1,312
  3. JDVDeisgn

    JDVDeisgn

    Joined:
    Oct 17, 2015
    Posts:
    148
  4. rasmus-unity

    rasmus-unity

    Unity Technologies

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    That happens because of your
    Code (CSharp):
    1. if (ballsleft.ballsleftv == 0f) {
    statement in code, which continues to evaluate to true. A quick way to fix it would be to set a boolean variable when player has 0 balls left, and show ads based on that. And reset the boolean when you are showing the ad. Or something like that, many ways to solve it.

    -Rasmus
     
  5. JDVDeisgn

    JDVDeisgn

    Joined:
    Oct 17, 2015
    Posts:
    148
    it still shows a sample ad in my build. is it supposed to be like that?
     
  6. rasmus-unity

    rasmus-unity

    Unity Technologies

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    Have you verified you are not passing "true" to Initialize() call and also that your game doesn't have testmode enabled on https://dashboard.unityads.unity3d.com ?

    -Rasmus