When I click the start game button, I want the interstitial ad to appear, how do I do it?(Blueprint)(Admob)
What, specifically, are you having trouble with?
Do you already have a start game button? What does it currently do?
Your title says “without a plugin” – but you also say “Admob.”
Are you currently able to show an Admob ad?
Or, to put it another way:
- Is your question “how do I show something when the player presses the start button, before the game starts?”
- Or is your question “how do I show admob ads without a plugin?”
For the former, it’s easy: Simply bind the button event handler to some function that shows whatever UI widget you want to show, rather than calling “load level” or whatever. Then have some button or click handler in that UI widget, or a timer, that ends up calling the “start game” functionality you really have.
For the second, I’m not sure you can do it without a plugin. Ad providers generally want to avoid fraud, so they generally have fancy APIs that integrate with the platform and application to reduce that, and that generally comes as a plugin.
Let’s say I use Admob settings or start game button pressed, I want the admob ad to appear directly in front of me when I press the button (interstitial ad),Do you think this bp is correct?
Loops in event handlers are always trouble, because the event may happen again.
Delays in event handlers are also problematic, for the same reason.
It’s much better to set a timer, or maybe poll in Event Tick.
So, when the game first starts, you would call “Load Interstitial Ad” so that the main screen can mask the loading latency.
Then when player presses start, you check whether the ad is requested. If that fails, just go straight to the game – the provider has no ads for you at this time.
If it is successfully requested, set a timer that fires every 0.1 seconds, that checks if the ad is available. If so, show the interstitial and cancel this timer.
Else, if timing out after 5 seconds, start the game anyway.
I would expect the flow to be something like this:
Of course, this is all documented with brief one-liners that tell us nothing about how to actually use the system, and the Android C++ source code just thunks into some Java platform binding goop, so it’s hard to know what’s really going on here.
"If the ad cannot be used straight out of the box, then it should have been mentioned in the documentation itself to save users from wasting time figuring it out on their own.