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

Resolved HttpException

Discussion in 'Leaderboards' started by borbejonry, Jul 4, 2023.

  1. borbejonry

    borbejonry

    Joined:
    Jan 5, 2022
    Posts:
    3
    UnityEngine: 2022.3.2f1


    upload_2023-7-4_14-13-23.png
    I am encountering this error after I tried using the sample LeaderboardsSample script from the package.

    There's no data yet and the leaderboard has already been set-up in unity gaming services, and the initialize for anonymous sign-in is already detected.
    I am trying to add a score. Anyone know why adding a score is having this error, and how to fix this?
     

    Attached Files:

    • s12.JPG
      s12.JPG
      File size:
      37.2 KB
      Views:
      30
  2. EmilF_Unity

    EmilF_Unity

    Unity Technologies

    Joined:
    Jun 10, 2022
    Posts:
    16
    Hi borbejonry, the exception
    Leaderboard config could not be found
    indicates that it is unable to find the leaderboard as created via the dashboard (or the API). This could be due to a mismatching leaderboard ID, or project ID or environment ID. Could you verify that those parameters are correct?
     
  3. borbejonry

    borbejonry

    Joined:
    Jan 5, 2022
    Posts:
    3
    upon checking
    -leaderboard ID in unity project is the same in the Unity Gaming Service.
    -project ID is the same based on the link project settings services.

    For the environment ID, How do I know which environment ID is being used in the Unity Editor?

    Code (CSharp):
    1. await LeaderboardsService.Instance.AddPlayerScoreAsync(LeaderboardId, 102);
     
    Last edited: Jul 4, 2023
  4. EmilF_Unity

    EmilF_Unity

    Unity Technologies

    Joined:
    Jun 10, 2022
    Posts:
    16
    By default when we initialize the Unity Core SDK with
    await UnityServices.InitializeAsync();
    it will use the "production" environment, but that can be changed to use a different environment by using initialization options as per the docs here.
     
    mamendozamiranda likes this.
  5. borbejonry

    borbejonry

    Joined:
    Jan 5, 2022
    Posts:
    3
    Upon changing the environment name from the initialization options made it work.
    Thank you very much.