an object reference is required for the non static field error

I’m trying to set a state in another script:

// Rubber Spider
    private enum RubberSpiderQuest
    private RubberSpiderQuest myRubberSpiderQuest;

    public static void startRubberSpiderQuest()
        myRubberSpiderQuest = RubberSpiderQuest.started;


Something like that:
In my main script I’m trying to do this:

// Save Quest State

But In my UserInformation script I get the following error:

An object reference is required for the non-static field, method, or property ‘UserInformation.myRubberSpiderQuest’

Any idea how I correct this?

The issue is, because you’ve made startRubberSpiderQuest() static, it doesn’t know which RubberSpider instance’s myRubberSpiderQuest to set. myRubberSpiderQuest should be declared static as well. Otherwise, you will need to pass a RubberSpider object into the starter method.