How can I change the parent (base) value in a inheritance child?

public class ModManager : MonoBehaviour {

    public float test = 110;

    public class NodeValues : ModManager
    {
        public void Change() 
        {
            test += 30;
            //This does not change test in the parent class = 110
        }
    }

      private void ChangeClass()
    {
        NodeValues nodeValue = new NodeValues();
        nodeValue.Change();
    }

What is the proper way to change test in the ModManager class through NodeValues?

I think you don’t understand what a base class and a derived class actually is.

First of all you added a derived class (NodeValues) as nested class to your base class (ModManager). That usually doesn’t make much sense. Furthermore your base class is derived from MonoBehaviour so you can’t create an instance with “new”. Every class that is derived from MonoBehaviour need to be placed into it’s own file with the file name matching the class name.

“NodeValues” is a seperate class. Just because it’s declared inside your ModManager it has no relation to the base class itself. It’s derived from ModManager so itself is also a ModManager.

Given that you place both classes into seperate files so you can actually use them, attaching ModManager to a gameobject will create an instance of the ModManager class.

Now if you also attach the NodeValues class to a gameobject those are two seperate instances which have no relation to each other. The NodeValues instance also has a “test” field since that’s what the class inherited from the ModManager class. But the two instances are completely different objects.

From your code we can’t really figure out what you actually want to achieve. Without a description of what you want we can’t suggest anything. The inheritance NodeValues → ModManager seems strange given those names.

Try base.test += 30;

If that doesn’t work, I can give you an extended answer.