question

Z. avatar image
Z. asked

Statistic sum aggregation not adding

Hi,

Was trying to add level to my characters, but the sum aggregation does not seem to be working.

The code:

server.UpdateCharacterStatistics
        ({
            PlayFabId : currentPlayerId,
            CharacterId : characterID,
            CharacterStatistics :
            {
                "UnitLevel": 4
            }
        })

All other aggregation methods work as intended, but no matter the value I input for sum, it does not add.

Title ID: 2DCF4

Thanks!

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Citrus Yan avatar image
Citrus Yan answered

Currently Statistic Definitions (either set from the Game Manager or the CreatePlayerStatisticDefinition API) are specific to Player Statistics. Hence aggregation method along with other settings are only configurable for Player Statistics, not Character Statistics. You can make feature request about it here: https://community.playfab.com/spaces/24/index.html

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Z. avatar image Z. commented ·

Thanks for the response.

Right, just realized that Min and Max are not setting the intended values as well.

So the workaround for this would be to Get > Add > Set?

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan Z. commented ·

Yes, that's correct.

1 Like 1 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.