- Home /
banner ad over a button, AdMob plugin problem
So, I managed to integrated ads(I'm using admob 2.1 plugin) into my android game, but now i encountered another problem: I cannot click ad without clicking button behind it. And i cannot move this button because it takes almost whole screen. I tried Gui buttons, OnMouseDown, and touchposition as a button, but neither of those helped.So what can I do to end this?
Thank you
i don't know what you mean but touchpositions nor do i use admob plugin, but my guess is you can use raycasting to detect click on button, and then execute button code only when banner is not displayed or click is outside of banner. I solved a similar problem like this (overlapping buttons)
but how can I know that click is outside of banner? I'm using smart banners with suppose to fit every screen resolution, and I haven't found a way to check their size. And as for touchposition,here's some code for it:
void Update()
{
if (Input.touchCount > 0)
{
Touch touch = Input.touches [0];
if (touch.phase == TouchPhase.Began)
{
if (touch.position.y > Screen.height* 0.5f) {
// code for button to do
Application.LoadLevel(1);
}
}
}
}
Answer by unimechanic · Oct 01, 2014 at 03:47 PM
Also ask to AdMob support, they should have more information on how to achieve this.
Answer by vfxjex · Jun 24, 2015 at 03:46 AM
use a smaller banner settings. like Banner instead of Full Banner. you can also check resolution of the device before showing the banner and show banner size base on device resolution.
Your answer
Follow this Question
Related Questions
Animator.Update High CPU Usage on Unity 5 resulting in bugs on Android 0 Answers
Button not update()ing,Button not updating 1 Answer
GUI button in middle of screen 2 Answers
Holding GUI Button Touch to Rotate Object 0 Answers
Editing Android Plugins 0 Answers