Cloud Code reading Cloud Save Data?

Hello,

I am trying to make my Unity Cloud Code read Unity Save > Player Data > (desired player) > “Player_Info”, but i keep running into error. Here’s the JS server side code:

 let playerDataResponse;
    try {
      playerDataResponse = await context.services.data.read({ keys: [Player_Info] });
    } catch (readError) {
      console.error("Error reading player data:", readError);
      return { result: false, message: "Failed to read player data from Cloud Save."};
    }

Other part of the script is trying to read other data and try to attempt to upgrade player’s unit and return info if it’s done or not. Unity Documentation did not help me much with this.

Any idea why this is not working?

Hey!
What error are you getting?

It’s worth looking at the samples, here’s one: GitHub · Enterprise

On the other hand, i’d recommend using CLoudCode Modules (C#), they’re easier to use overall.

1 Like

Thank you very much, I’ll look it up once I’m able.

The error is simply not being able to get to the data:
“Failed to read player data from Cloud Save”