PlayerPrefs not working in another scene

I’m trying to make a leveling system for my game but when I’m trying to get a playerpref to another float in another scene it doesnt work I was using

void Start()
    {
        
        health = PlayerPrefs.GetFloat("health");
        currentHealth = health;

        HealthBar.value = CalculateHealth();
    }

Try with this :slight_smile:

//In first Scene set Health like this.
PlayerPrefs.SetFloat("Health", 100.0f);

And in another Scene use this. 
PlayerPrefs.GetFloat("Health", 0);

//this zero in the end is default value