- Home /
My ad doesnt play on startup...
I want it so my Unity Ad plays on startup. Right now the only way i can get it to work is with a button that triggers the function... Im using the standard example code!
using UnityEngine; using UnityEngine.Advertisements;
public class UnityAdsExample : MonoBehaviour
{
public void ShowAd()
{
if (Advertisement.IsReady())
{
Advertisement.Show();
}
}
}
Answer by TheMrAngel · Feb 17, 2016 at 09:42 PM
@voporak5 may be right. Are you calling the method ShowAd() at Start(), so it gets triggered?
If you do, maybe the problem is that you didn't initialize the ad before. I think you already did it because you said that you can trigger and ad with a button, BUT, if not:
Make sure to put this at the Start() method in order to initialize the advertisements:
Advertisement.Initialize ("gameID", true);
So the engine will start downloading and preparing the Ads in order to show them later.
gameID is the game ID you get at the Unity Ads dashboard when you registered your app.
And you can set true or false (true will show just false ads, intended just for testing purposes).
Ive used Unity Ads before, and the new dashboard kinda confuses me... but this solved the problem. Thanks so much
Your answer
Follow this Question
Related Questions
Unity Ads not working? 1 Answer
Unity ads folder being created 1 Answer
Unity ads are working in the editor but not as apk 0 Answers
Downloading Sponsored Apps 0 Answers