How do I make a "cloud variable"?

Hello!

Short things short, is there any (free) way to store a variable (preferrably a dictionary, but integers would suffice) on the cloud?

I want to be able to do roughly this:

using SomeService;

class ExampleClass : Monobehaviour
{
    SomeService.CreateInt("exampleInt", 5);
    var result = SomeService.GetInt("previouslyCreatedInt");
    SomeService.SetInt("exampleInt", 8);
    Debug.Log(SomeService.GetInt("exampleInt")); // Returns 8
}

I also want other players playing the game to be able to get the updated int in real time. Is there some service that does this? I tried RemoteConfig (can’t set the value), CloudCode (can’t even persistently store a variable), and CloudSave (only works for singleplayer).

Any help would be appreciated.

Thanks!

No, it’s not only for single player. You can use CloudSave’s “GameData” feature for exactly this kind of thing.

Firebase Remote Config is free: Firebase Remote Config

Wow, you saved me at least a few hours of searching. Thanks!

One more thing:
In the Unity Cloud Dashboard, in Cloud Save, in Game Data, the whole thing is blank. I cannot create any values for some reason. Here is an image:


Do you know how I can write values?

Thanks

1 Like

Hi @Arcane_Creator

Theres a section here Integrate with other Unity services which has some samples of writing to Cloud Save from Cloud Code.

Hopefully theres enough there to enable you to get started.

Yes, I have started using it and gotten a bucketload of errors, but I will probably be able to debug it in time.

Thanks for your response