I have studied object oriented programming and unity in general for a while now. However I’m still not sure how to accomplish the following:
Say I make a base character class that contains all the attributes shared by both players and enemies (strength, dex, intelligence etc.) and I want to create unique instances of this class and attach those instances to game objects. These instances could in turn be used by other scripts that control combat etc. It’s vital that the instances have differing values on the attributes contained in the base character class. What is the best way to create instances like that?
I couldn’t work out how to do this so I just made two separate scripts that basically did exactly the same thing and attached those scripts to the player and enemy game objects. Very bad coding practice, I know, but I’m not sure how to use inheritance etc. as surely the script would have to inherit from monobehaviour if I am going to attach it to an object?