- Home /
Problem is not reproducible or outdated
Why is Unity Ads not showing an ad in unity 5.2?
I'm using Unity 5.2, and attached the following script to the main camera: using UnityEngine; using UnityEngine.Advertisements; using System.Collections;
public class Ads : MonoBehaviour {
// Use this for initialization
void Start() {
ShowAd();
}
public void ShowAd()
{
if (Advertisement.IsReady())
{
Advertisement.Show();
}
}
}
Why is Unity Ads not showing an ad? What did I wrong? Thanks in advance.
Answer by whaleinthesea · Sep 26, 2015 at 09:58 AM
UnityAds have to download the ads first and that take some time, use
IEnumerator ShowAd() {
while (!Advertisement.IsReady()) {
yield return null;
}
Advertisement.Show();
}
to show the ad when it is downloaded
How would the full code look like? Im sorey but I dont usually use C#.
Answer by jamiahuswalton · Oct 31, 2016 at 06:50 PM
I found that I needed to initialize my Advertisement before it started to work. After that, I needed to wait until my ad was ready to be displayed. Code snippet below.
Answer by Dragon_Developer · Sep 25, 2015 at 07:57 AM
UnityAds only works if you are on mobile, in the editor it wont work ;/
But why is Unity not showing this example 'ad' on this page: http://answers.unity3d.com/questions/1067354/how-to-use-the-new-unity-ads.html#answer-1067459 ?
Did you create an unityAds account (and linked it)?
yes, its automatically linked in Unity 5.2 EDIT: Even on my mobile it doesn't work.
Answer by seth_slax · Sep 26, 2015 at 05:52 PM
In the editor it should show the default image to say that your ads are working. If this isn't the case, check UnityAds to make sure you have the latest version, and also check if it's compatible with Unity 5. Also throw in some Debug.Logs, particularly in an else statement underneath, like this:
if (Advertisement.IsReady())
{
Advertisement.Show();
}
else{
Debug.Log("Advertisment is not ready.");
}
Check the docs to make sure you've set it up properly, make sure you're not building with Dev Mode enabled, and make sure the little box on the Helper Script (if you're using it) is unchecked. Pretty sure it's something like Testing Mode.
I had the same problem and tried for some time.
In the end i found out, that the default Zone name is not "rewardedVideoZone" but "rewardedVideo".
So yeah, configuration error.
Answer by HappySaila · Mar 02, 2017 at 10:42 AM
FIXED!
After fiddling around a lot I found the solution.
In Unity Ads > click on your game > Click on your game store listing (eg the tab that has your game ID in > Click on settings next to ad filtering > And turn "Override client test mode OFF!
For all with this problem: Test Ads in Fresh Project. It can be project settings.
Follow this Question
Related Questions
Unity Ads Banner not working. 0 Answers
Unity rewarded ad is not giving reward 0 Answers
Unity ads ecpm went high then back to really low 0 Answers
Chartboost adds are not showing up on android 0 Answers
Help implementing unity ads 1 Answer