Playmaker Forum

PlayMaker Help & Tips => Unity Services => Topic started by: marcos on September 05, 2014, 06:01:52 AM

Title: Unity Ads
Post by: marcos on September 05, 2014, 06:01:52 AM
Hey,

Would be great to have a set of actions for Unity Ads:

https://www.assetstore.unity3d.com/en/#!/content/21027

Regards,
Mark.
Title: Re: Unity Ads
Post by: Fahrettin on September 07, 2014, 03:48:19 AM
No answer for Unity Ads ?
Title: Re: Unity Ads
Post by: escpodgames on September 07, 2014, 11:12:21 PM
I'm making the actions now ... :)
Title: Re: Unity Ads
Post by: escpodgames on September 07, 2014, 11:42:42 PM
http://hutonggames.com/playmakerforum/index.php?topic=8311.0

Easy mode!
Title: Re: Unity Ads
Post by: Fahrettin on September 08, 2014, 07:16:26 AM
Thanks LampRabbit  ;)
Title: Re: Unity Ads
Post by: marcos on September 08, 2014, 10:52:36 PM
Oh wow!

Thank you, sir!
Title: Re: Unity Ads
Post by: escpodgames on September 08, 2014, 11:10:29 PM
np, I'll be adding allowPrecache, isInitialized, isShowing and isSupported actions as well as a separate isReady/show ad action when I get time.
Title: Re: Unity Ads
Post by: PaulH on December 08, 2014, 01:26:25 PM
np, I'll be adding allowPrecache, isInitialized, isShowing and isSupported actions as well as a separate isReady/show ad action when I get time.

Hi LampRabbit

did you ever do the other actions you mentioned above? i could really use them now. especially the isInitialized, because i noticed if there is a slow internet connection while unity ads are being initialized, it can almost crash your game if the user tries to play it at the same time they are being initialized.

so i would like to be able to check if in fact they are initialiezed before the user can play.

cheers.
Title: Re: Unity Ads
Post by: escpodgames on December 08, 2014, 11:02:52 PM
Check out the post by cloud03

http://hutonggames.com/playmakerforum/index.php?topic=8311.0

What I do is stop inputs and then show the ad with the engine being paused. Then when the engine is unpaused I wait a fraction of time and then turn inputs back on.
Title: Re: Unity Ads
Post by: PaulH on December 10, 2014, 10:47:10 AM
Check out the post by cloud03

http://hutonggames.com/playmakerforum/index.php?topic=8311.0

What I do is stop inputs and then show the ad with the engine being paused. Then when the engine is unpaused I wait a fraction of time and then turn inputs back on.

could i ask one more favor? do you know how i check if the user actually finished watching the video ad? because as it is now in my game, the user watches the vid (using the 2 actions we have available init and show) and then once finished i give the reward on the next state. I do it this way because i don't know how to set up the reward system in unity ads.

but...my problem is, if the user (on ios) hits the home button on ipad/iphone etc while the ad is playing and then starts the app straight back up, they cut the ad off and then get the reward without actually watching it. I just need to do a quick check to see if they actually finished the ad so i can then proceed to give the reward if they did, if not then i dont.

i found this onVideoCompleted(String itemKey, boolean skipped) but i dont know how to implement it.

Thanks in advance for your help.

Title: Re: Unity Ads
Post by: escpodgames on December 10, 2014, 04:11:27 PM
I don't think his can be done with an action, will add it to my long list.
Title: Re: Unity Ads
Post by: PaulH on December 10, 2014, 04:35:55 PM
I don't think his can be done with an action, will add it to my long list.

i think this is the code for it in bold:


    public static void ShowAd (string zone = null, bool pauseGameDuringAd = true)
    {
        if (string.IsNullOrEmpty(zone)) zone = null;
     
        ShowOptions options = new ShowOptions();
        options.pause = pauseGameDuringAd;
        options.resultCallback = HandleShowResult;
       
        Advertisement.Show(zone,options);
    }
       
    public static void HandleShowResult (ShowResult result)
    {
        switch (result)
        {
        case ShowResult.Finished:
            Debug.Log("The ad was successfully shown.");
            break;
        case ShowResult.Skipped:
            Debug.Log("The ad was skipped before reaching the end.");
            break;
        case ShowResult.Failed:
            Debug.LogError("The ad failed to be shown.");
            break;
        }
    }



am i right in thinking the action would just need an playmaker FSM.event for each of the cases in the switch statement?

http://forum.unity3d.com/threads/question-concerning-video-adds-return-value.279849/

i think thats all it needs but i dont know how to do it. when i add a fsm.event to each of them i get an error.

this is the last thing i need before i click submit to the app store, so i would be so grateful if you could take a look.

cheers.
Title: Re: Unity Ads
Post by: escpodgames on December 10, 2014, 04:53:54 PM
Hmmm, might have to give cloud03 a personal message, I'm not sure how to handle that ... I still think a proxy script might be needed but I could be wrong :S
Title: Re: Unity Ads
Post by: rik on December 12, 2014, 01:42:07 AM
Hi can some one tell me which plugin was good for admob playmaker integration i am trying to use admob with playmaker using android native but there is no plamaker scene can some one help me.

problem is ad id was string but playmaker action was int so i cannot paste my admob id some one using this can guide me
Title: Re: Unity Ads
Post by: xhidnoda on January 05, 2015, 03:56:16 PM
Hi...!
there are a unity package for this? :P
Title: Re: Unity Ads
Post by: nepomuk on May 20, 2015, 11:47:55 AM
any ways to send an event right when the ad is closed?
Title: Re: Unity Ads
Post by: weilies on August 25, 2015, 08:19:48 AM
Can unity ads show in unity game simulator? Or it has to be run on mobile even for development?
Title: Re: Unity Ads
Post by: xhidnoda on August 25, 2015, 09:17:04 AM
@weilies

YES...but only a banner test.
Title: Re: Unity Ads
Post by: weilies on August 27, 2015, 03:38:56 AM
i downloaded the unityads package and when i run the game, it just show a small cube and no test ads.

There is no error logged, and it stucked in state 1 and i was expecting it should goes to either state 2-5 but it doesn't.

i am not sure which part goes wrong
Title: Re: Unity Ads
Post by: weilies on August 27, 2015, 12:04:44 PM
i managed to resolve it, looks like i didn't set the device platform correctly.

now it directly goto "Ad Unavailable Event". What mistake did i made? There is no ad pop up either.
Title: Re: Unity Ads
Post by: xhidnoda on August 27, 2015, 02:22:24 PM
just test in your device bro  :P
Title: Re: Unity Ads
Post by: weilies on August 29, 2015, 12:15:19 AM
My developer cert expired.

I am thinking to get things work before renew my license.
There really isn't a way to do that?


i follow youtube tutorial and come across the unity package
https://github.com/Applifier/unity-ads-helper

it does showing ads either i set device to iOS or Android, it worked for both (check out my attached screenshot). So, it means we can test inside Unity and restricted to just device.

There must be some setup missing or the Playmaker's Unity Ads is outdated. I wish the author can give me some pointers.
Title: Re: Unity Ads
Post by: weilies on August 30, 2015, 04:06:45 AM

Finally i am able to make the ads working with Playmaker :)
It looks like the Init and ShowAds has to be seperate state (previously i merged both when game load, so it doesn't show up)
Title: Re: Unity Ads
Post by: xhidnoda on August 31, 2015, 01:41:13 PM
great!  ;)
Title: Re: Unity Ads
Post by: dougbello on September 12, 2015, 06:58:04 PM
Can someone help?

I had to update to unity 5 and now I'm having this problems... Everything was working fine awesome, I think its just adjust 2 or 3 commands in the actions.

But I can not code at all.

**The erros unity is giving me are:**

Assets/PlayMaker/Actions/UnityAds/UnityAds_Initialize.cs(27,47): warning CS0618: `UnityEngine.Advertisements.Advertisement.allowPrecache' is obsolete: `Advertisement.allowPrecache is no longer supported and does nothing'


Assets/PlayMaker/Actions/UnityAds/UnityAds_ShowAd.cs(46,58): warning CS0618: `UnityEngine.Advertisements.Advertisement.isReady(string)' is obsolete: `Use Advertisement.IsReady method instead'


Assets/PlayMaker/Actions/UnityAds/UnityAds_ShowAd.cs(53,106): warning CS0618: `UnityEngine.Advertisements.ShowOptions.pause' is obsolete: `ShowOptions.pause is no longer supported and does nothing, video ads will always pause the game'


Assets/PlayMaker/Actions/UnityAds/UnityAds_ShowAd.cs(55,91): warning CS0618: `UnityEngine.Advertisements.ShowOptions.pause' is obsolete: `ShowOptions.pause is no longer supported and does nothing, video ads will always pause the game'
Assets/scripts/controle ads.cs(26,35): warning CS0618: `UnityEngine.Advertisements.Advertisement.isReady(string)' is obsolete: `Use Advertisement.IsReady method instead'

Can anyone help?
Thanks
Doug.
Title: Re: Unity Ads
Post by: szomaza on September 14, 2015, 05:29:35 AM
In Unity 5.2.0f3 I get:
Assets/PlayMaker Custom Actions/UnityAds/UnityAds_ShowAd.cs(27,47): error CS0433: The imported type `UnityEngine.Advertisements.ShowResult' is defined multiple times

Much changes, probably because:
https://unity3d.com/unity/whats-new/unity-5.2
"It comes with the Services Window for easy SDK-free access to Unity Ads, Unity Analytics, Unity Cloud Build and Unity Multiplayer."

I guess the Unity Ads scripts by LampRabbit might need considerable updating:
http://hutonggames.com/playmakerforum/index.php?topic=8311.45

Please help!
szomaza
Title: Re: Unity Ads
Post by: xhidnoda on September 14, 2015, 09:06:20 AM
I send message to LampRabbit
Title: Re: Unity Ads
Post by: escpodgames on September 14, 2015, 05:49:05 PM
Hey Guys,

Unity have made UnityAds part of Unity now and I can only assume broken the actions for anything above 5.2. I would love to help but I am super busy trying to get my game done (gah)
Title: Re: Unity Ads
Post by: dougbello on September 14, 2015, 07:38:02 PM
Thanks LampRabbit, but maybe someone else can help.

This should be priority on Playmaker, once is now inside unity and we need that to try to make some money.

Maybe Alex can help, I cannot code but I don't think it should be very complicated once you did everything already.

Please someone help!

My game (that I spent 4 months doing) is almost ready, just missing this actions to finish. It was working fine but I was dumb enough to update my unity and now it break the unity ads.

PLease!!

Doug.
Title: Re: Unity Ads
Post by: jeanfabre on September 15, 2015, 01:31:32 AM
Hi,

 I made a trello task for it. I'll get that sorted in the next few days, and I'll put it on the Ecosystem too for convenience.

https://trello.com/c/zemFf5B7/145-unityads-for-u5-2


Bye,

 JEan
Title: Re: Unity Ads
Post by: BlamSammich on January 20, 2016, 07:51:05 AM
Hey peoples. Im using unity 5.1 and for some reason unity ads keep failing.
I think the actions are still working, But I am constantly getting "ad failed" results. All worked fine before. So not sure the issue.
Updated unity ads and playmaker but still failong to pull ads.
Pls help
Thanks
Title: Re: Unity Ads
Post by: jeanfabre on January 20, 2016, 08:13:48 AM
Hi,

The actions covered here works for Unity 5.2+. On previous versions it seems you need to install the package, and that it behaves differently for some reason.

 I strongly suggest you try on a fresh project using Unity 5.3 just to make sure where the problem is.

 also, are you on android on IOS, and are you testing on the device itself?

Bye,

 Jean
Title: Re: Unity Ads
Post by: Fahrettin on December 14, 2016, 05:10:18 PM
Thanks for the actions for unity ads. I make them work really easy.
My problem is i cant separate normal videos and rewarded videos. It always shows normal ones. Do you guys have any tips for rewarded videos ?
Title: Re: Unity Ads
Post by: jeanfabre on December 15, 2016, 02:22:00 AM
Hi,

 I am not sure I understand the difference myself. you decide upon the feedback of the video playback if you are going to reward the user of not.

 else, maybe you have a link explaining what you want to achieve?

 Bye,

 Jean
Title: Re: Unity Ads
Post by: szomaza on December 15, 2016, 05:23:55 AM
Fahrettin, maybe you might have rewarded video disabled in Unity Ads Monetize dashboard?
Check those settings.

(They works for me on Android and iOS also.)

Br,
szomaza
Title: Re: Unity Ads
Post by: szomaza on December 21, 2016, 04:10:00 AM
Is anybody using Unity Ads with Unity 5.5?
Do the playmaker actions still work?

Just asking before I update my project.
It would be nice to be able to show brand ads also.

"Unity Ads 2.0 now built into 5.5! This updates Unity Ads from 1.5 to 2.0 through the Services window in Unity. If you're using Unity 5.5 or later, simply enable the Ads service to get both Game Ads AND Brand Ads. "

Thanks,
szomaza
Title: Re: Unity Ads
Post by: Robiwan on December 29, 2016, 07:08:22 AM
Is anybody using Unity Ads with Unity 5.5?
Do the playmaker actions still work?

Just asking before I update my project.
It would be nice to be able to show brand ads also.

"Unity Ads 2.0 now built into 5.5! This updates Unity Ads from 1.5 to 2.0 through the Services window in Unity. If you're using Unity 5.5 or later, simply enable the Ads service to get both Game Ads AND Brand Ads. "

Thanks,
szomaza

Did you get it working, I'm struggeling on my project as well. I made a separate forum thread on the subject, http://hutonggames.com/playmakerforum/index.php?topic=14097.0
Title: Re: Unity Ads
Post by: szomaza on December 29, 2016, 08:52:50 AM
No, I have not tried upgrading yet.
Please post here when you figure out what it takes.

Thanks,
szomaza