Well, the variable “pickedUp” is never used anywhere. You only assign values to it but you never read that value anywhere. So it serves no purpose at all. That’s what the compiler has figured out. If can do this because the variable is private, so no other outside script or class could potentially access the value. So what’s the point of having it and assigning values to it?
In the end it’s just a warning, not an error. So the compiler tells you that this has no purpose and probably should be removed. Of course, maybe you need that state somewhere in the future, which is fine. However until you actually using the value the compiler will throw that warning against you.
ps: Please do not hijack other people’s posts, especially when they are 4+ years old. Create your own thread and when posting code, use code tags. There are two sticky posts in the scripting forum: Unity community code of conduct and one explaining how to use code tags properly. Please read them before posting. You already made 12 posts here on the forum and each of them was a necro post to hijack an old post, so it’s time to learn the rules