Hello,
I was wondering, if you can change the customData of another User via script?
Thank you,
Tim
Yes, you can call Update on any User class object even if it's not the local player.
If you haven't loaded a User class object (with User.Load or Random), you can just set the Id, for example:
user.id = "123";
user.customData["Key"] = "Value";
user.Update(null);
FRANCESCO CROCETTI @ SKARED CREATIONS
Thank you very much for that great and fast answer!
Yes, you can call Update on any User class object even if it's not the local player.
If you haven't loaded a User class object (with User.Load or Random), you can just set the Id, for example:
User user = new User();
user.id = "123";
user.customData["Key"] = "Value";
user.Update(null);
Hi. I have a similar need (save custom data from another user). I try this code, but I get the error "user.id is read-only". Any ideas how to solve this? Thanks in advance.
Yes, the things changed in v3 to adhere to the Unity’s SocialPlatform system and interfaces, the safest way is to use User.Load passing the id (if you haven’t a User object already loaded) and then change the customData in its callback if it was successful.
FRANCESCO CROCETTI @ SKARED CREATIONS