Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Remotesettings:default values?

Discussion in 'Unity Analytics' started by John1515, Oct 13, 2017.

  1. John1515

    John1515

    Joined:
    Nov 29, 2012
    Posts:
    248
    Hi,
    Have successfully implemented remote settings but a few details are unclear to me around the behaviour of the variables when the user has no internet connection:
    1. If a user starts the app first time, without internet. What settings are used? The ones showing in the remote settings window in the editor at the time of build?
    2. When I give a public variable a value in the inspector, will this value be taken or the one from #1 when the user starts the app without internet?
    3. Say the user has gotten internet at some point and syncs. But then starts a session without internet: will the last known values be assigned, or the value from the inspector (#2), or the defaults (#1).
    Thanks so much :)
     
  2. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    That depends on how you implement Remote Settings. You can find more details in the Remote Settings scripting page. In general, you should use assign default values in your RemoteSettings method calls, in case of this situation.

    https://docs.unity3d.com/Manual/UnityAnalyticsRemoteSettingsScripting.html

    It will use the default value not the value from the Inspector. The best practice may be to use a similar approach as the example script. Create a variable that is visible in the Inspector and set that as the default. That way the correct default is loaded, but you can modify it in the Inspector as needed.

    It will use the last known Remote Settings value.
     
  3. John1515

    John1515

    Joined:
    Nov 29, 2012
    Posts:
    248
    Ah, i hadn't looked at the remote settings scripting so much as I have only used the remote settings component. But I think I am all set now :) Thanks!