question

brendan avatar image
brendan asked

Remove Player Data based on Keys

deadstarcgs
started a topic on Tue, 27 January 2015 at 2:18 PM

I've been trying to find a way to remove a specific piece of Player Data from a player (the same as if I'd pressed the delete button from the Game Manager), but I can't seem to find a way to do this from the API using Unity or through Cloud Scripting.

Have I missed a piece of code? Or is this something that hasn't been implemented as yet?

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

·
brendan avatar image
brendan answered

Best Answer
Brendan Vanous said on Tue, 27 January 2015 at 5:23 PM

Specifying a null value removes the key, while specifying it with an empty string results in a Key with an empty value.


4 Comments
Brendan Vanous said on Tue, 27 January 2015 at 4:59 PM

To remove a Key from a user's UserData store, simply call UpdateUserData with the Key having a null value (specifically null, as opposed to an empty string).


deadstarcgs said on Tue, 27 January 2015 at 5:20 PM

Will this remove the key entirely though, or just leave the key there with an empty value?


Brendan Vanous said on Tue, 27 January 2015 at 5:23 PM

Specifying a null value removes the key, while specifying it with an empty string results in a Key with an empty value.


deadstarcgs said on Tue, 27 January 2015 at 5:30 PM

Fantastic, that's what I wanted to hear, thanks!

1 comment
10 |1200

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

cogjourney avatar image cogjourney commented ·

THANK YOU SO MUCH. This has been giving me so much trouble.

0 Likes 0 ·

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.