PlayerPrefs.GetInt("i" + i.ToString()); Question

HI there,
I am having trouble implementing a certain aspect of my game.

I want to select a team of players from the teamSelectLevel. These players have certain vars set in each, through PlayerPrefs which I will call on the game play scene. My issue is that I am setting my vars like this…

PlayerPrefs.SetInt("player" + count.ToString() + "index",  count);

My thought is, that as the count rolls thru, I can assign that object as player1index = 1, player2index = 2… My issue is retrieving that info. When I load my game play level, I have objects which are already assigned indexes, I just want to retrieve the info from the indexes set and apply it, to the objects, waiting for the relevant data.

So, on gamePlay level, player1, must ask for player1index.

My issue is that I can not get that numeral value.

index = PlayerPrefs.GetInt("player" + someValue.ToString + "index");

…always turns up, index = 0.

???Am I doing this right? I think I am, but it is not setting for some reason.

In your get statement is the missing ‘()’ at ToString() just a typo you made here or actual code?

You should make sure both strings you use for getting and setting the playerprefs are EXACTLY the same. So do Debug.Log(“player” + count + “index”) and both places and to make sure you use the same key for get and set.
(when adding an int to a string you can omit the .ToString() btw)