How to use DefVideoAds (Unity ads)?

hello so i am close to finish my game and I want to add unity ads I created a mobile game project to test before I add it to the main project I didn’t really understand the example project from github so please tell how to add a interstitial add to this script when I click on the screen I already fetch the library:

    function init(self)
    	msg.post(".", "acquire_input_focus")
    	msg.post("@render:", "use_fixed_fit_projection", { near = -1, far = 1 })
    end

    function on_input(self, action_id, action)
    	if action_id == hash("touch") and action.pressed then
    		print("Touch!")
    	end
    end
1 Like

Let us know what from the example project is not understandable?

There is an example for interstitial ads there, everything used there must be used.

At first you need to initialize the ads and you need to have the Unity’s Monetization ID, so you need to have account there - did you manage to do so? :wink:

1 Like

I know this is an old Topic but im just trying to do this myself.

Does the project example work on defold 1.9.0? its just I downloaded the demo and ran the project and I cant see how they get enabled as it does not let you click on any of the buttons or even the screen.

I noticed everywere in the demo it checks the unity ads are enabled by using the following.

 if unityads then

So i went searching through the scripts and demo files and cant find anywere that variable is created or enabled

thanks

It works only on mobile (iOS/Android), where ADS is supported

1 Like

Yep :slight_smile: , that is why should not jump straight into new stuff without the morning cup of tea :smiley: , like an idiot just downloaded the test project and ran it on laptop, once on mobile all kicks into place as expected im an idiot

1 Like