Hi guys,
I am encountering a small problem,
When I use AddUserVirtualCurrencyRequest, the amount i fill in is 100, but playfab api ads the double.
This is my code:
public void AddKr(int Punten) { AddUserVirtualCurrencyRequest request = new AddUserVirtualCurrencyRequest() { VirtualCurrency = "Kr", Amount = Punten }; PlayFabClientAPI.AddUserVirtualCurrency (request, _Result, _Error); }
And this is what i see in dashboard of playfab.
My second problem is with updating the virtual currency amount of the player, after succesfully adding vc I update the field that holds the information.
void _Result(ModifyUserVirtualCurrencyResult _thisResult) { ExecuteAfterTime (10); } IEnumerator ExecuteAfterTime(float time) { yield return new WaitForSeconds(time); GetKr(); } public void GetKr() { GetUserInventoryRequest requestInv = new GetUserInventoryRequest() { }; PlayFabClientAPI.GetUserInventory(requestInv, (resultInv) => { foreach (var item in resultInv.VirtualCurrency) { Points.text = item.Value.ToString(); } }, (errorInv) => { Points.text = errorInv.ErrorMessage; }); }
The problem is, it doesn't update, am I doing something wrong?
BTW I develop in Unity.
With kind regards