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

Bug The transitions from ads back to my game are really abrupt !

Discussion in 'Unity Ads & User Acquisition' started by drazuerg, Jul 26, 2023.

  1. drazuerg

    drazuerg

    Joined:
    Jan 31, 2014
    Posts:
    46
    Hello !

    I'm working on implementing ads in a game.
    I noticed the transition when returning from ads back to the game being really abrupt. So I've created an empty project with just one scene and a button to trigger an ad, and still have the same issue ...

    Here's an illustration of what I mean (at 37 seconds) ->

    The screen "flickers" when it gets back to the game.
    On such a simple scene it's not that bad but when there is actual gameplay + animation, perception gets much worse.

    I've used Unity 2021.3.17, also tried with 2022.1.14.
    Using the classic Unity Ad package.
    Recorded on Android phone.

    Any idea how to fix that ?

    Thanks for your help :)
     
    Last edited: Jul 26, 2023
  2. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    592
    I'm not seeing the same issue on my end, have you ever tested it on other devices? Also, could you share the .apk file here so I can test it?
     
  3. drazuerg

    drazuerg

    Joined:
    Jan 31, 2014
    Posts:
    46
    Thanks SamOY for your quick reply, much appreciated !

    I did test on 3 devices yes :
    • Realme GT Master Edition running Realme UI 4.0
    • Xiaomi Mi9T running MIUI 12.1.1
    • Redmi 7A running MIUI 12.5.3
    They all have this "sideways sliding page" transition, which almost always ends up flickering.

    I also thought it came from my devices but other games I've tested so far that use ads on Unity don't trigger the same behavior.

    Here's the .apk -> https://drive.google.com/file/d/18e0RHjkJ3gHIw_x4rjm9WSNF1piHq_5-/view?usp=drive_link (folder is public so you should have access, otherwise let me know !)

    Thanks again for your support.
     
    Last edited: Jul 27, 2023
  4. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    592
    You are very welcome! I saw the below error message in the device log, are you trying to show another Ad when an Ad is showing? If so, this might cause problems. Please fix it first and then see if the "flickers" problem still persists.
    E/UnityAds: com.unity3d.services.core.api.Sdk.logError() (line:76) :: Show invocation failed: Can't show a new ad unit when ad unit is already open
     
  5. drazuerg

    drazuerg

    Joined:
    Jan 31, 2014
    Posts:
    46
    Good point, I also see this error in Android Logcat.

    However I'm not sure why this is happening.

    The project couldn't be much simpler actually.
    I have an AdsInitializer script that basically initializes the ads. Straight up copy paste from there :) https://docs.unity.com/ads/en-us/manual/InitializingTheUnitySDK
    And I've just added the "LoadAd()" call once it's initalized :

    Code (CSharp):
    1. public void OnInitializationComplete()
    2.     {
    3.         Debug.Log("Unity Ads initialization complete.");
    4.         rewardedAdsButton.LoadAd();
    5.     }
    And I have a RewardedAdsButton script attached to the single button from the scene. Straight up copy paste from there also : https://docs.unity.com/ads/en-us/manual/ImplementingRewardedAdsUnity

    So there is just one ad that gets loaded, and I press the button just once which shows the ad (I cannot press it twice actually since it becomes non interactable once it's pressed).

    Here's a zip file containing the whole project, would it help you help me ? :)
    https://drive.google.com/file/d/1QVtDe7yJoqCQpjQLHcmuG4EMWH7-y2yW/view?usp=drive_link

    Thanks a lot,
    Pierre
     
  6. drazuerg

    drazuerg

    Joined:
    Jan 31, 2014
    Posts:
    46
    Additional information : I tested on iOS (iPhone 6S), there is still a "sliding page" transition but no flickering it seems (00:33)


    So:
    1. It looks like it's something that happens on Android only
    2. I really wish this transition could be deactivated. Do you know if there is a way to configure that somehow ?
     
  7. drazuerg

    drazuerg

    Joined:
    Jan 31, 2014
    Posts:
    46
    Hi there !

    @SamOYUnity3D I might have another lead...
    Don't know if it's related or not, but when I switch from another app to my app, I get the "flicker". I guess this is related to the app going to focus again (which might be what happens when I get back from an ad ?)

    In this video, I switch back and forth from my app to Dunk Shot (which I believe is also made in Unity), and Dunk Shot doesn't get the flicker but my App does ...


    Could it be related to some sort of "out of focus" configuration ?
     
  8. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    592
    The "flickering" issue might not be caused by the Unity Ads SDK, will the app still have this issue if the Unity Ads SDK is removed?
     
  9. drazuerg

    drazuerg

    Joined:
    Jan 31, 2014
    Posts:
    46
    Good question, so I created a completely empty project, no Ads SDK at all, to see if I could repro this and yes, same issue :




    I also thought this might come from Mono vs IL2CPP compilation.
    So I tried creating another completely empty project, no Ads, in IL2CPP and still get the flicker (note that it's a little bit emphasized by the recording ; it's still there without recording but a bit less pregnant) :

     
  10. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    592
  11. drazuerg

    drazuerg

    Joined:
    Jan 31, 2014
    Posts:
    46
    Ok will do that, thanks for your help :)
    Have a good day !