π·πΊ Π ΡΡΡΠΊΠ°Ρ Π²Π΅ΡΡΠΈΡ
Android plugin for Godot 4 that integrates VK Ads SDK (myTarget).
Supports banner, interstitial, and rewarded video ads.
Only works on Android. On other platforms the plugin gracefully does nothing.
- Godot 4.x
- Android export with Gradle build enabled
Download and unpack the latest release archive.
Copy the addons/GodotAndroidVkAds folder into the root of your Godot project.
Open Project β Project Settings β Plugins and enable GodotAndroidVkAds.
In the export settings:
- Enable Use Gradle Build
- Under Permissions, enable
Access Network StateandInternet
In android/build/build.gradle, add the following inside the android {} block:
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}Create a Node in your scene and attach the vk_ads.gd script from the plugin folder.
The VkAds node exposes the following exported properties:
| Property | Type | Description |
|---|---|---|
banner_id |
int |
Slot ID for banner ads |
banner_on_top |
bool |
Show banner at top (true) or bottom (false, default) |
interstitial_id |
int |
Slot ID for interstitial ads |
rewarded_id |
int |
Slot ID for rewarded video ads |
Set the slot IDs in the Inspector:
load_banner() -> void # Load and display the banner
show_banner() -> void # Show a previously hidden banner
hide_banner() -> void # Hide the banner (keeps it in memory)
get_banner_dimension() -> Vector2 # Returns banner size in pixelsload_interstitial() -> void # Load an interstitial ad
show_interstitial() -> void # Show the loaded interstitial
is_interstitial_loaded() -> bool # Check if interstitial is readyload_rewarded_video() -> void # Load a rewarded video ad
show_rewarded_video() -> void # Show the loaded rewarded video
is_rewarded_video_loaded() -> bool # Check if rewarded video is ready| Signal | Arguments | Description |
|---|---|---|
banner_loaded |
β | Banner loaded successfully |
banner_failed_to_load |
error_code: int |
Banner failed to load |
| Signal | Arguments | Description |
|---|---|---|
interstitial_loaded |
β | Interstitial loaded successfully |
interstitial_failed_to_load |
error_code: int |
Interstitial failed to load |
interstitial_closed |
β | User closed the interstitial |
| Signal | Arguments | Description |
|---|---|---|
rewarded_video_loaded |
β | Rewarded video loaded successfully |
rewarded_video_failed_to_load |
error_code: int |
Rewarded video failed to load |
rewarded_video_closed |
β | User closed the rewarded video |
rewarded |
type: String |
User earned a reward |
extends Node
func _ready():
# Connect signals
$VkAds.banner_loaded.connect(_on_banner_loaded)
$VkAds.banner_failed_to_load.connect(_on_banner_failed_to_load)
$VkAds.interstitial_loaded.connect(_on_interstitial_loaded)
$VkAds.rewarded_video_loaded.connect(_on_rewarded_video_loaded)
$VkAds.rewarded.connect(_on_rewarded)
# Load banner immediately
$VkAds.load_banner()
func _on_banner_loaded():
$VkAds.show_banner()
func _on_banner_failed_to_load(error_code: int):
print("Banner failed: ", error_code)
# Call this when you want to show an interstitial
func show_interstitial_ad():
if $VkAds.is_interstitial_loaded():
$VkAds.show_interstitial()
else:
$VkAds.load_interstitial()
func _on_interstitial_loaded():
$VkAds.show_interstitial()
# Call this when you want to show a rewarded video
func show_rewarded_ad():
if $VkAds.is_rewarded_video_loaded():
$VkAds.show_rewarded_video()
else:
$VkAds.load_rewarded_video()
func _on_rewarded_video_loaded():
$VkAds.show_rewarded_video()
func _on_rewarded(type: String):
print("Reward earned: ", type)
# Grant the reward to the player hereA full example project is available here.






