Search Unity

Initial display lag

Discussion in 'Unity Ads & User Acquisition' started by udik, Jan 21, 2015.

  1. udik

    udik

    Joined:
    Oct 9, 2013
    Posts:
    37
    Sorry if this has been posted before..

    Just created the first game with Unity Ads, using their example. I did the integration using Unity itself (CS code) not via any Android specific code. When I run the game on Android, and click the button to show ad, it takes around 20 sec for the ad to show and play (its a short video.. I guess), while waiting the screen is black. Obviously this is not production worthy..

    I have a super fast Samsung S4 and running over super fast FIOS wifi.

    Appreciate any ideas..

    Thanks,
    Udi
     
  2. unity-nikkolai

    unity-nikkolai

    Joined:
    Sep 18, 2014
    Posts:
    540
    How soon after initialization are you attempting to show the ad? It's possible the video is still being cached.

    We have an update on it's way that will be addressing some of these issues. I'll let you know as soon as it's live.
     
  3. udik

    udik

    Joined:
    Oct 9, 2013
    Posts:
    37
    Thanks for the input! I am trying I guess 30 sec or so after starting of the app.. I can give it more time and check. Thing is in prod, I was planing on displaying the ad as soon as the app starts :)
     
  4. udik

    udik

    Joined:
    Oct 9, 2013
    Posts:
    37
    Also.. I was using Unity 4.5.4, should I upgrade Unity to latest or to 4.6? would it make a difference?
     
  5. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I would recommend you upgrade to 4.6.1
     
    unity-nikkolai likes this.
  6. unity-nikkolai

    unity-nikkolai

    Joined:
    Sep 18, 2014
    Posts:
    540
    Best to use the latest. This goes for both Unity and Unity Ads.

    A number of changes and fixes have been made on both sides since Unity 4.5.4, so backup your project first before upgrading. There's a chance the upgrade will require you to fix some of your code in your project. The backup will be there in case you're unable to resolve any issues that arise.

    You might also find this post helpful. There's some integration code in there that uses yield statements to wait until Unity Ads is initialized and ready before showing an ad on start.

    Here is another integration example that I like to show off. It uses the UnityAdsHelper script.
     
  7. udik

    udik

    Joined:
    Oct 9, 2013
    Posts:
    37
    Thanks for the info! will implement and observer any improvements.

    Quick questions - sometimes when the screen is black (or blank, however you wanna call it) it almost seems like there are simply no campaign ads available for display(?) does this make sense? I know issues like this happens in other ad programs like AdmMob. If so, I wonder if there is a way to verify that ad is really available and also "load it in the background" so that it will 100% play when the .show() is called.

    Also.. not totally related but maybe another bug.. when an ad video is playing and I touch the screen it says "player error"...
     
  8. unity-nikkolai

    unity-nikkolai

    Joined:
    Sep 18, 2014
    Posts:
    540
    Are you calling Advertisement.isReady() before attempting to show an ad?

    You could be seeing this issue if the speed or quality of your network connection is not up to snuff. Unity Ads first attempts to download the entire video. If it has not done so before the call to Advertisement.Show() is made, then it will attempt to stream the video.

    There's an update on the way with improvements for video caching and network error handling. In addition to checking if ads are available and the zone is ready, it also tests the speed and quality of the network connection. If the bandwidth is not suitable for streaming, then the Advertisement.isReady() method will return false.