PlayerPrefs + SetActive

Hello! I have made so when I pickup the weapon, I unlock an Image (Set Active) and that’s working.
But now I want to save it in PlayerPrefs, how could I do it?

My Pickup Script:

public class WeaponPickUp : MonoBehaviour
{
    public string weaponName;
    public static Image unlockImage; // This is the Image

    private void Awake()
    {
       // Find the Weapon Name and Unlock Text
        unlockImage = GameObject.Find(weaponName + " " + "Unlock").GetComponent<Image>();
    }

   private void OnTriggerStay(Collider other)
    {

        if (other.tag == "Player")
        {
            if (Input.GetKeyDown(KeyCode.E))
            {
                // Remove the Unlock Image
                unlockImage.GetComponent<Image>().gameObject.SetActive(false);
                Destroy(gameObject, 1.5f);
            } 
        }
    }


}

I’m not sure how to save PlayerPrefs with bools, I have find some solutions but it’s not working.

This thread seems to be a very similar problem to yours. Might have some insights for you:

Basic playerPrefs does not save bools. So you can save an int instead and just use 0 for false or 1 for true. Depending on the number of pickups, that may be the easiest to do. Otherwise, saving out a list of strings may work as well. The thread @takatok posted does offer more insight into some ways of doing these things.

Thanks alot! I answer late because i worked. Now i’m back Home. I going to try that.