Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Advertisement.Banner.SetPosition() Bug

Discussion in 'Unity Ads' started by hypergolic-games, Apr 3, 2020.

  1. hypergolic-games

    hypergolic-games

    Joined:
    Feb 17, 2018
    Posts:
    94
    Hello!

    I currently have an Android game (that supports banner ads) that is in play testing. One of the issues that has been raised is that on a few levels, the banner can get in the way of gameplay.

    I do not want the banner to show on the main menu, so it is shown on level start and hidden on level end and its position can be specified on a per level basis.

    The banner is being shown using the following code...

    Code (CSharp):
    1. while (!Advertisement.IsReady(...))
    2.     yield return new WaitForSeconds(0.25f);
    3.  
    4. Advertisement.Banner.SetPosition(...);
    5.  
    6. Advertisement.Banner.Show(...);
    And hidden like this...

    Code (CSharp):
    1. Advertisement.Banner.Hide();
    The trouble is, once the banner has been shown on one level (let's say bottom centre) then the next time it is shown (let's say top right) it will always show in the position it was first shown, no matter what is passed to SetPosition. So in this example, the banner will always be shown bottom centre regardless.

    I've tried moving SetPosition before IsReady but it doesn't make any difference. Any help would be much appreciated.

    I'm using Unity 2019.2.21f1 and Advertisment 3.4.4
     
    Last edited: Apr 6, 2020
  2. kr-unity

    kr-unity

    Unity Technologies

    Joined:
    Jan 6, 2020
    Posts:
    172
    Hey @PInvoke, thanks for reporting this.

    I was able to reproduce the same thing in my internal test app. I'll check with the development team and see what's going on.
     
    hypergolic-games likes this.
  3. hypergolic-games

    hypergolic-games

    Joined:
    Feb 17, 2018
    Posts:
    94
    Many thanks.
     
  4. hypergolic-games

    hypergolic-games

    Joined:
    Feb 17, 2018
    Posts:
    94
    Hi kr-unity,

    Is there any news on a fix please? Am hoping it's a simple issue that can be released to the 3.4 stream?

    Failing that, do you know of a way to work around it please?
     
  5. kr-unity

    kr-unity

    Unity Technologies

    Joined:
    Jan 6, 2020
    Posts:
    172
    Hey, sorry for the delay in responding. Unfortunately, we don't currently have an estimate for when this will be addressed. Apologies.
     
    hypergolic-games likes this.
  6. hypergolic-games

    hypergolic-games

    Joined:
    Feb 17, 2018
    Posts:
    94
    Ok, thanks for the prompt reply.

    This has pretty much stopped me being able to use banner ads in my game (am sure I'm not the only one) so hopefully a fix won't be too long in the making.

    Are you aware of a way to work around it by any chance please?
     
  7. kr-unity

    kr-unity

    Unity Technologies

    Joined:
    Jan 6, 2020
    Posts:
    172
    Unfortunately no, there currently isn't a way around this. I've made the SDK team aware that this is an issue, however, so keep an eye out and it may be addressed in a future version.
     
  8. djtim3000

    djtim3000

    Joined:
    Jun 5, 2018
    Posts:
    2
    Any update on this one? I need to be able to change the position of banner ads depending on the state of my game. Not being able to do something which seems to be a relatively simple implementation is incredibly frustrating. It feels as though Banner Ads are more or less an afterthought for Unity IAP package.
     
    LLGD likes this.
unityunity