Coding Error

image

I have an issue where every time I save and exit, the volume is not actually changed in the PlayerPrefs. The code prints out correctly what the difficulty should be (e.g. “difficulty set to 5”), but then test is always 0. I’ve been stuck on this for a while now so any help would be greatly appreciated, thanks :slight_smile:

Hi,

What does GetDifficulty return?

It returns 0 as far as I can see since this is what test prints.

And where does the 0 come from?

float GetDifficulty()
{
     return 0f;
}

This method returns 0 as well but I assume that’s not what you have in your code.

Oh, I see the issue is with my other method which was returning an int rather than a float. I forgot there was another method in the code. Thanks for the help, I was trying to fix that for way to long lol

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms