Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Unity load other player data from cloud?

Discussion in 'Cloud Save' started by BrightRocket987, Aug 5, 2023.

  1. BrightRocket987

    BrightRocket987

    Joined:
    Jul 26, 2021
    Posts:
    7
    I am making a game, and save items to the cloud that includes their scores. I need a way to either save/load somewhere else, OR use cloud save to load other players' data... once I figure that out, I need to load a few players items that have a close score to the searched one.

    -player1

    ------item
    ------------score(50)

    ------item
    ------------score(1)


    -player2

    ------item
    ------------score(5)

    ------item
    ------------score(51)

    -Local player(searches for score of 50)
    --gets both items in players 1 and 2 with scores close to 50 and(unrelated): adds the player+item to a list
     
  2. BrightRocket987

    BrightRocket987

    Joined:
    Jul 26, 2021
    Posts:
    7
    if this is not possible, I would appreciate ANY databases I can use, it simply needs to store files, and have a query/search system.

    I did look into firestore, but there is no way to use it in a desktop app, unless you go through a web, and I don't really want to have to deal with that
     
  3. UnityManuJack

    UnityManuJack

    Unity Technologies

    Joined:
    May 30, 2019
    Posts:
    11
    Hi!

    You can use cloud code to access others player data and write a search method for your use case. It is recommended to use the C# module of cloud code so you can setup a repository with your own backend code.

    You can also use Custom Items (using Cloud Code or API) from Cloud Save to save custom data that isn't tied to a player id.

    If you are looking at managing player scores, the Leaderboard service might fit your needs!

    We are looking at introducing features such as querying and/or databases. Stay tuned!
     
    Last edited: Aug 7, 2023
  4. BrightRocket987

    BrightRocket987

    Joined:
    Jul 26, 2021
    Posts:
    7
    Thanks, i have never used the Cloud Code API, is there documentation with examples I could see?, how would I do a query? would a query work even when their connected to player ID's?
     
  5. BrightRocket987

    BrightRocket987

    Joined:
    Jul 26, 2021
    Posts:
    7
    still not sure how to do this, as I'm not really good at JS at all, and I can't figure out how to do it with C#... any help appreciated... any other databases I could use? I'm hoping I can save/load and query folders with json files, one includes the score. so I need to query(search) based on the score jsons', and load the other json files