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.

Question How does Economy & Environments work together? How to push values from one environment to the other?

Discussion in 'Economy' started by soleron, Feb 10, 2022.

  1. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    492
    How does Economy and Environments work together?

    My initial idea about the usage was that this was some sort of staging for QA and other testing, and production was the live server. However using all these features confused me quite a bit about the use cases of Environments as well as the workflow of Economy.

    I created a set of items, (currency. inventory items etc.) and although I have not published them, I was able to pull the values from the server. How is this possible if they are not published? And if they are published the moment I create them, what does "Publish" do?

    Can we push changes from one environment to the other? If yes, how?

    Another thing that confused us was that we could pull and combine functions and data from two different environments without even setting the environments in the script. Shouldn't we state the environment before pulling data from the server?

    Many questions, but I believe they will help others too.
     
  2. Laurie-Unity

    Laurie-Unity

    Unity Technologies

    Joined:
    Mar 5, 2020
    Posts:
    174
    Hi Soleron,

    The purpose of environments is to allow you to create Development, Staging and Production environments so you can test things without fear of exposing real players to it inadvertantly or polluting your production data with development tests.

    Your post suggests that you may have uncovered some unintentional behaviour.
    • A player shouldn't be able to access un-published items
    • It shouldn't be possible to access multiple environments at the same time
    I'll need to dig into this a bit deeper and attempt to reproduce it in order to validate if it is a bug.

    The environments functionality is a recent addition to the Beta, so there is still further functionality to roll out. I will pass your comments on promoting changes from one environment to another along to ensure they are being considered.

    In the meantime, can you confirm which versions of the UGS packages are in your project by sharing the snippet from your Packages/manifest.json file. Feel free to share your projectId with me by DM if you want me take a look at your environment configuration?
     
  3. VagelisGardikis

    VagelisGardikis

    Joined:
    Apr 24, 2018
    Posts:
    20
    Hey Soleron, about your last question about specification of the environment, there is this in documentation.
    upload_2022-2-22_11-38-31.png
    So it defaults the production environment, if you dont specify it yourself
     
    FabriR likes this.