So I’m trying to build a skill system, these skills do things such as give the player more HP, taking less damage on the 10th hit, or making the player able to light enemies on fire. Most of these skills have unique functionality. So far I have a scriptable object base class which skills inherit from and each skill has it’s own class which holds it’s functionality. But every skill usually has to have it’s own class AND a scriptable object to work. And it also fills up the asset menu. This method seems tedious and it just “feels” wrong, I also plan on making hundreds of these. I’m looking for a better way of making this since I feel my current method is not the best and that it will be very annoying later on. I really appreciate any help I can get, thanks!
This might not be the cleanest way of doing it but I would use an array of bools and comment each index’s skill. This way they can be turned on and off at will and you can have all the player’s logic in one script like this.
//more HP
if(skillBoolArray[0])
{
//functionality
}
void OnCollisionEnter(Collision other) //or however damage is took.
{
//take less damage
if(skillBoolArray[1])
{
//functionality
}
}