Hi guys,
How do I reward a player for watching a UnityAds video?
Thanks in advance
Hi guys,
How do I reward a player for watching a UnityAds video?
Thanks in advance
You decide. Giving them an extra life, in-game virtual money, new characters etc.
Although not sure I understood your question correct…
/Rasmus
From time to time, I want to show player an option to watch a video to get coins. Now the question stands, is there an API for that: like check if video was watched, or force video to be full etc.
Assuming you are integrating ads into a Unity game, in which case we have a simple example on https://unityads.unity3d.com/help/Documentation%20for%20Publishers/Integration-Guide-for-Unity-Asset-Store
I.e. you can pass a callback method when calling Advertisement.Show(), and check if the result was Finished (note: enum value, not string - not obvious from the sample code)
Hope this answers your question.
/Rasmus
Hi,
Could you please give me an example on how can I run a function when the video is finished?
Many thanks!
See e.g. c# - resultCallback for Unity Ads to only reward if video finished - Stack Overflow
Using an older version of SDK, so e.g. change isReady() to IsReady(), but otherwise you can use this.
Thanks a lot @rasmus-unity
How do I force player to watch the whole video?
You specify the rewarded zone id (default “rewardedVideoZone” these days) in your call to IsReady() and Show() methods, e.g.
if (!Advertisement.IsReady("rewardedVideoZone"))
{
Debug.Log("Ads not ready");
return;
}
Advertisement.Show("rewardedVideoZone", ...);
Alright! It works! Thanks a lot rasmus!