question

Julien SEGERS avatar image
Julien SEGERS asked

Saving a custom character as a JSON

Hello,

I have a character customisation scene in Unity, where the player can swap hair/head/face/body etc... as MeshRenderer (and SkinnedMeshRenderer for the body).

I have a way to serialize those into a JSON which I'm sending to Player Data, but my file is 22KB due to the list of bones needed for the SkinnedMeshRenderer (in order to correctly swap the meshes without breaking them, I need the bones).

Is that too big for Player Data? Is there another way?

Also, I didn't find a way to use CloudScript to swap the meshes (and verify they are legitimate)... Any help?

Thank you for your time!

Kind regards

Player Dataunity3dCharacter Data
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

·
Sarah Zhang avatar image
Sarah Zhang answered

>> Is that too big for Player Data? Is there another way?

You can navigate to [Game Manager]->[Title Settings]->[Limits] or https://developer.playfab.com/en-US/[YourTitleId]/limits to check the limits of your title. According to the [Limits] page’s description, the maximum size of Player Data value can’t exceed to 300,000 bytes, it means you can store around 300KB UTF-8 encoded bytes in the value of Player Data. So, 22KB won’t exceed the limit, it’s small enough.

>> Also, I didn't find a way to use CloudScript to swap the meshes (and verify they are legitimate)... Any help?

According to your description, you will store the mesh data as the JSON in the Player Data. For such appearance data, especially when the clothes and accessories are purchasable items, we would more suggest you store them in the Read-Only Player Data. So, your question can be understood as how to update Read-Only Player Data in the CloudScript, right? If so, you can refer to this tutorial – Howto modify read-only or internal player data from CloudScript - PlayFab |Microsoft Docs to learn about how to set the Player Read-Only Data from CloudScript.

About how to verify if mesh data is legitimate, could you please clarify which things do you want to verify? Is there a specific application scenario?

10 |1200

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

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.