Class Inheritance

Hi, I am new to Unity and I have been writing scripts that inherit each other, but in a way that I think is bad, and I was wondering if I could do it in another way.8552840--1143596--Project VX - Microsoft Visual Studio 10_31_2022 8_06_47 PM.png

Over here, I need the PlayerControl Class to inherit SpeedBoost, but I also need MonoBehaviour as well
in both of the classes, and since I can’t have it in both of the classes, I have to create a loop.
8552840--1143602--Project VX - Microsoft Visual Studio 10_31_2022 8_06_53 PM.png

And here, I need the DisplayRPM class to only be inherited to PlayerControl, but I have to inherit a few other classes to lastly get to the MonoBehaviour class.
8552840--1143608--Project VX - Microsoft Visual Studio 10_31_2022 8_06_58 PM.png

Here as well, I only need the GenerateObstacles class to be inherited to PlayerControl
8552840--1143611--Project VX - Microsoft Visual Studio 10_31_2022 8_07_03 PM.png

And it goes on into a loop, until I finally get to the class that inherits MonoBehaviour, the one I need in all of the classes.
8552840--1143614--Project VX - Microsoft Visual Studio 10_31_2022 8_07_08 PM.png

Now, the question is: Is there any way I could inherit MonoBehaviour in all of the classes, without having to inherit each class into the other one, just to finally get to MonoBehaviour?

So, to wrap things up: I need for the classes to be inherited to PlayerControl only, but not between each other, but at the same time I need to use MonoBehaviour in all of them, which gives me the error.

Yeah, that’s a mess.

You keep claiming “I need X to be inherited to Y,” but frankly I don’t believe you. I think you’re understanding what inheritance (in programming) means, and what it is for.

So, please back up. What is it you’re trying to accomplish?

So, I need a few of the public variables from the other classes to be inherited to the PlayerControl class. But, i also need MonoBehaviour as well in all of the classes, and if I try to inherit the classes into the PlayerControl class, I get an error saying I am inheriting MonoBehaviour multiple times.

Update: I figured out what I should have done, and it was declaring variables as static and access them trough: ClassName.Variable