Save cloned prefabs

For my Final Project. I have a game where when the player presses a button, it clones a prefab into a random position. I tries using player prefs to save the cloned object’s position but it doesn’t work. How do I save the cloned prefabs? Also how can I save if the prefab is destroyed?

you can use these things to save a value or position permanently :

  1. you can write the position of the prefab to a txt file (see file handling in unity)
  2. you can save to json file
  3. you can also user playerprefes, but for each position you have to use 3 float playerprefs: something like this:
    PlayerPrefes.Setfloat(“x”, your x-axis value);
    PlayerPrefes.Setfloat(“y”, your y-axis value);
    PlayerPrefes.Setfloat(“z”, your z-axis value);