- Home /
Skill system where every skill has unique functionality?
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!
Answer by Magso · Feb 17, 2020 at 10:24 PM
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
}
}
Your answer
Follow this Question
Related Questions
cloning of ScriptableObject 2 Answers
Problem with ScriptableObject and Custom Editor 2 Answers
UnityScript ScriptableObject error 1 Answer
Importing and using custom assets 0 Answers
Can you use a ScriptableObject to save game state? 6 Answers