Hi,
I want to store each enemys position with playerprefs and to store their position like this: PlayerPrefs.SetInt(x.‘enemys ID’ , posX);
I get error Assets/SurvivalAssets/Scripts/AdvancedAIV2.js(91,32): BCE0044: expecting ), found ‘EnemyID’.
Can anyone help me?
SetInt takes to arguments, a string, and then the int, see:
Your enemies’ ID must be stored somewhere. Is that an int, or a string. Make sure it’s a string, and pass that string into SetInt.
Yes, but is there a way to do this with something like dot syntax(like objects or structures in c++)? Because I don’t want to manualy change all keys. With my syntax I must change just one variable in the top of my script and in yours solution i must manualy change all keys.
Oh…
Can I do like this?:
var ID=“Enemy 1.1”;
PlayerPrefs.SetInt(ID, 10);