- Home /
Unity Admob glitching game screen
Im using Admob in my unity game for android. I want to have reward videos. My game's orientation is set to portrait only and when the admob reward video shows it glitches the screen out and makes it go horizonal and chopped in half.
How do i solve this. This is not a question about how to set the orientation of the ad.. i know i cant.. This is a question about the screen getting chopped in half and glitching out.
Answer by kornstar83 · Jun 08, 2017 at 10:20 AM
I'm currently using Unity Ads to run my rewarded video ads, I also have a game that is played in portrait orientation, the landscape interstitial ads seem to work just fine.
could you show me your code for calling the ad and/or project settings?
Here is the code:
using UnityEngine;
using UnityEngine.Advertisements;
public class VideoAdHandler : $$anonymous$$onoBehaviour
{
public void ShowRewardedAd()
{
if (Advertisement.IsReady("rewardedVideo"))
{
var options = new ShowOptions { resultCallback = HandleShowResult };
Advertisement.Show("rewardedVideo", options);
}
}
private void HandleShowResult(ShowResult result)
{
switch (result)
{
case ShowResult.Finished:
Debug.Log("The ad was successfully shown.");
//Add payment code here
break;
case ShowResult.Skipped:
Debug.Log("The ad was skipped before reaching the end.");
break;
case ShowResult.Failed:
Debug.LogError("The ad failed to be shown.");
break;
}
}
}
As for project settings you just need to click Window > Services or press ctrl + 0, to open the services tab and simply turn on unity Ads, have a button call the ShowRewardedAd() function and it should all work.
not that I know of, Unity Ads and Ad$$anonymous$$ob are completely different.
I havent used Ad$$anonymous$$ob yet because it was a pain trying to get the Admob stuff working and it only took about 5 $$anonymous$$s including the time it took to type the script with Unity Ads.
If you are dead set on using Ad$$anonymous$$ob then someone else will have to help you, I have no experience with it, sorry