How to find a variable int with a string?

So I have my script set up finding a variable in another script using and it works just fine using “Item1” since “Item1” is a variable in Inventory script. Code:

GameObject helper = GameObject.Find (“Helper”);
Inventory inventory = helper.GetComponent ();
if (inventory.Item1 == 0) {
Debug.Log (“TA DA”);

But is it possible to replace:

if (inventory.Item1 == 0) {


public string SOMESTRINGHERE = Item1; (or whatever I need)

if (inventory.SOMESTRINGHERE == 0) {

So that I can change it from the editor that way I can make a prefab where I can change it to whatever I need?

@PigChop I’m not 100% clear on what you’re wanting to do, but it sounds like maybe you want to use SerializedProperty