Multi-scene projects
The recommended way to use the Admob Plugin in a multi-scene Godot project is as follows:
- Create a new scene for managing Ads (ie. named
AdManager).- Attach a script to the root node
- Add an
Admobnode to the new scene@onready, link to anadmob_nodevariable
- Connect all signals and keep all ad logic in this script
- From Godot Editor's
Project->Project Settings...menu, select theGlobalstab- Set this new scene as an
Autoload
- Set this new scene as an
After setting this scene as an Autoload, the Admob Plugin methods can be invoked from any scene as shown in the following example: