Remote Config Fetch returning zero values.

I’m using Unity 2019.4.0f1 with remote config 1.0.9
Environment: development
I’m setting the values from remote config to a scriptable object.
When my game starts and remote config data fetch is completed all the values are set to zero.
It worked yesterday with the same code. but now not working (both editor and android build

Code:

using UnityEngine;
using Unity.RemoteConfig;

public class RemoteConfigController : MonoBehaviour
{
    public static RemoteConfigController currentRemoteConfigController;

    public struct userAttributes
    {
        // Optionally declare variables for any custom user attributes; if none keep an empty struct:
    }

    public struct appAttributes
    {
        // Optionally declare variables for any custom app attributes; if none keep an empty struct:
    }

    // Optionally declare a unique assignmentId if you need it for tracking:
    [SerializeField] private GameConfigurationData gameConfigSettingsRemote;

    void Awake()
    {
        if (currentRemoteConfigController != null && currentRemoteConfigController != this)
        {
            Destroy(currentRemoteConfigController.gameObject);
        }
        currentRemoteConfigController = this;
        DontDestroyOnLoad(currentRemoteConfigController.gameObject);

        ConfigManager.FetchCompleted += ApplyRemoteSettings;
        //FetchGameConfigData();
    }

    public void FetchGameConfigData()
    {
        ConfigManager.FetchConfigs<userAttributes, appAttributes>(new userAttributes(), new appAttributes());
    }

    void ApplyRemoteSettings(ConfigResponse configResponse)
    {
        // Conditionally update settings, depending on the response's origin:
        switch (configResponse.requestOrigin)
        {
            case ConfigOrigin.Default:
                Debug.Log("No settings loaded this session; using default values.");
                break;
            case ConfigOrigin.Cached:
                Debug.Log("No settings loaded this session; using cached values from a previous session.");
                LoadConfigData();
                break;
            case ConfigOrigin.Remote:
                Debug.Log("New settings loaded this session; update values accordingly.");
                LoadConfigData();
                break;
        }
    }

    void LoadConfigData()
    {
        gameConfigSettingsRemote.enemySpawnDelayMin = ConfigManager.appConfig.GetFloat("enemySpawnDelayMin");
        gameConfigSettingsRemote.enemySpawnDelayMax = ConfigManager.appConfig.GetFloat("enemySpawnDelayMax");
        gameConfigSettingsRemote.enemySpawnDistanceMin = ConfigManager.appConfig.GetFloat("enemySpawnDistanceMin");
        gameConfigSettingsRemote.enemySpawnDistanceMax = ConfigManager.appConfig.GetFloat("enemySpawnDistanceMax");

        gameConfigSettingsRemote.enemyCountLevelStart = ConfigManager.appConfig.GetInt("enemyCountLevelStart");
        gameConfigSettingsRemote.enemyCountLevelMax = ConfigManager.appConfig.GetInt("enemyCountLevelMax");
        gameConfigSettingsRemote.enemyCountLevelIncrease = ConfigManager.appConfig.GetInt("enemyCountLevelIncrease");

        gameConfigSettingsRemote.enemyLifeLevelStart = ConfigManager.appConfig.GetInt("enemyLifeLevelStart");
        gameConfigSettingsRemote.enemyLifeLevelMax = ConfigManager.appConfig.GetInt("enemyLifeLevelMax");
        gameConfigSettingsRemote.enemyLifeLevelIncrease = ConfigManager.appConfig.GetInt("enemyLifeLevelIncrease");

        gameConfigSettingsRemote.enemyLifetimeLevelStart = ConfigManager.appConfig.GetFloat("enemyLifetimeLevelStart");
        gameConfigSettingsRemote.enemyLifetimeLevelMax = ConfigManager.appConfig.GetFloat("enemyLifetimeLevelMax");
        gameConfigSettingsRemote.enemyLifetimeLevelIncrease = ConfigManager.appConfig.GetFloat("enemyLifetimeLevelIncrease");

        gameConfigSettingsRemote.enemySpeedLevelStart = ConfigManager.appConfig.GetFloat("enemySpeedLevelStart");
        gameConfigSettingsRemote.enemySpeedLevelMax = ConfigManager.appConfig.GetFloat("enemySpeedLevelMax");
        gameConfigSettingsRemote.enemySpeedLevelIncrease = ConfigManager.appConfig.GetFloat("enemySpeedLevelIncrease");

        gameConfigSettingsRemote.enemyTurnSpeedLevelStart = ConfigManager.appConfig.GetFloat("enemyTurnSpeedLevelStart");
        gameConfigSettingsRemote.enemyTurnSpeedLevelMax = ConfigManager.appConfig.GetFloat("enemyTurnSpeedLevelMax");
        gameConfigSettingsRemote.enemyTurnSpeedLevelIncrease = ConfigManager.appConfig.GetFloat("enemyTurnSpeedLevelIncrease");

        gameConfigSettingsRemote.enemyDeathVolume = ConfigManager.appConfig.GetFloat("enemyDeathVolume");

        gameConfigSettingsRemote.playerSpeed = ConfigManager.appConfig.GetFloat("playerSpeed");

        gameConfigSettingsRemote.playerGunLifetime0 = ConfigManager.appConfig.GetFloat("playerGunLifetime0");
        gameConfigSettingsRemote.playerGunLifetime1 = ConfigManager.appConfig.GetFloat("playerGunLifetime1");
        gameConfigSettingsRemote.playerGunLifetime2 = ConfigManager.appConfig.GetFloat("playerGunLifetime2");

        gameConfigSettingsRemote.playerGunDamage0 = ConfigManager.appConfig.GetInt("playerGunDamage0");
        gameConfigSettingsRemote.playerGunDamage1 = ConfigManager.appConfig.GetInt("playerGunDamage1");
        gameConfigSettingsRemote.playerGunDamage2 = ConfigManager.appConfig.GetInt("playerGunDamage2");

        gameConfigSettingsRemote.playerGunReloadtime0 = ConfigManager.appConfig.GetFloat("playerGunReloadtime0");
        gameConfigSettingsRemote.playerGunReloadtime1 = ConfigManager.appConfig.GetFloat("playerGunReloadtime1");
        gameConfigSettingsRemote.playerGunReloadtime2 = ConfigManager.appConfig.GetFloat("playerGunReloadtime2");

        gameConfigSettingsRemote.playerGunRange0 = ConfigManager.appConfig.GetFloat("playerGunRange0");
        gameConfigSettingsRemote.playerGunRange1 = ConfigManager.appConfig.GetFloat("playerGunRange1");
        gameConfigSettingsRemote.playerGunRange2 = ConfigManager.appConfig.GetFloat("playerGunRange2");

        gameConfigSettingsRemote.playerShieldVolume = ConfigManager.appConfig.GetFloat("playerShieldVolume");
        gameConfigSettingsRemote.playerAmmoShootVolume = ConfigManager.appConfig.GetFloat("playerAmmoShootVolume");
        gameConfigSettingsRemote.playerAmmoHitVolume = ConfigManager.appConfig.GetFloat("playerAmmoHitVolume");
        gameConfigSettingsRemote.playerFootstepVolume = ConfigManager.appConfig.GetFloat("playerFootstepVolume");
        gameConfigSettingsRemote.playerDeathVolume = ConfigManager.appConfig.GetFloat("playerDeathVolume");

        gameConfigSettingsRemote.pickupCountMax = ConfigManager.appConfig.GetInt("pickupCountMax");

        gameConfigSettingsRemote.pickupSpawnDelay = ConfigManager.appConfig.GetFloat("pickupSpawnDelay");
        gameConfigSettingsRemote.pickupVolume = ConfigManager.appConfig.GetFloat("pickupVolume");

        gameConfigSettingsRemote.gameMusicVolume = ConfigManager.appConfig.GetFloat("gameMusicVolume");

        gameConfigSettingsRemote.gameSittingPosePercentage = ConfigManager.appConfig.GetInt("gameSittingPosePercentage");
        gameConfigSettingsRemote.gameLayingPosePercentage = ConfigManager.appConfig.GetInt("gameLayingPosePercentage");
        gameConfigSettingsRemote.gameGroundPosePercentage = ConfigManager.appConfig.GetInt("gameGroundPosePercentage");

        gameConfigSettingsRemote.gameLevelChangeDelay = ConfigManager.appConfig.GetFloat("gameLevelChangeDelay");

        gameConfigSettingsRemote.gameRewardLevelCount = ConfigManager.appConfig.GetInt("gameRewardLevelCount");

        gameConfigSettingsRemote.playerStartingGemsCount = ConfigManager.appConfig.GetInt("playerStartingGemsCount");
        gameConfigSettingsRemote.playerGemsLevelStart = ConfigManager.appConfig.GetInt("playerGemsLevelStart");
        gameConfigSettingsRemote.playerGemsLevelMax = ConfigManager.appConfig.GetInt("playerGemsLevelMax");
        gameConfigSettingsRemote.playerGemsLevelIncrease = ConfigManager.appConfig.GetInt("playerGemsLevelIncrease");

        gameConfigSettingsRemote.playerGemPickupLifetime = ConfigManager.appConfig.GetFloat("playerGemPickupLifetime");

        gameConfigSettingsRemote.costUpgradeLevel1 = ConfigManager.appConfig.GetInt("costUpgradeLevel1");
        gameConfigSettingsRemote.costUpgradeLevel2 = ConfigManager.appConfig.GetInt("costUpgradeLevel2");

        gameConfigSettingsRemote.ammoLifetime = ConfigManager.appConfig.GetFloat("ammoLifetime");
        gameConfigSettingsRemote.ammoVelocity = ConfigManager.appConfig.GetFloat("ammoVelocity");

        gameConfigSettingsRemote.assignmentId = ConfigManager.appConfig.assignmentID;
    }

    void OnDestroy()
    {
        ConfigManager.FetchCompleted -= ApplyRemoteSettings;
    }
}

It only happens at the starting of the RemoteConfig Controller. After initialization, when I manually call the fetch function, it works!

Can you try with the most recent version? We have addressed similar issues, 1.3.2 looks to be the most recent. Also please provide the output of your Debug.Log statements when you run the game on the Android device, they will show in the logcat logs https://discussions.unity.com/t/699654 Perhaps add additional statements to confirm the code flow. Also, I believe I remember reading another forum post elsewhere last week where the user mentioned that the first time they ran a scriptable object in the editor, it didn’t initialize correctly on only the first run, but subsequently worked. Please debug to confirm if that applies here, but I suspect not. The device logs would confirm if it’s working as expected.

Hi is there a way to put MyGame(default) values I have created. and put in to release and debug.
why do I need to create same variables and values to release and debug? I might get wrong spelled and cause error.
How can I put the values I create on default and put it on debug and release.

Please elaborate on your issue, and show a screenshot of your issue. What do you mean “create on default”, please show your code and your values as defined in your Remote Config dashboard. Perhaps Copy Config would help you https://discussions.unity.com/t/779992 . I would encourage you to review the posts on this forum in the future

Its okay now, I just need to figure it out
This is what I meant
There is a copy config in the dashboard website but not on the editor.
What I mean is my variables I created in myGame(default) I can copy and put it on release or debug


6630532--756070--Screen Shot 2020-12-17 at 8.40.51 AM.png

Sorry I don’t quite follow. You can Push/Pull values from the Editor, is this what you mean? Is the Dashboard copy working for you? You stated “What I mean is my variables I created in myGame(default) I can copy and put it on release or debug” , does that it mean it’s working for you? There wasn’t a question.

This thread is digressing from the original topic “Returning zero values”, so please follow up in a new thread, thanks for understanding