::
Creating an ability system is quite complex. There are many ways to go about doing it, and a lot of the finer considerations will depend on how you want your ability system to work.
Personally, I will create a ScriptableObject
for abilities, the same way we have a scriptable object for weapons. The first thing I will look at is whether it is practical to make the Ability
a subclass of Item
(paired with AbilityData
), the same way Weapon
subclasses Item
. The difference between Weapon
and Ability
is that weapons are “passive” effects, in the sense that they activate by themselves; whereas abilities only activate when you click on a button (either in the UI, or on the keyboard). Otherwise, like weapons, they also have cooldowns and different stats.
For the dash ability, I would create an ability that adds a buff to the character. That buff will cause the character to dash towards a certain location for a short duration.
If you are not in a rush, you can consider waiting for Part 23, because I will be covering how to create a buff / debuff system for the player and enemies. Your ability system will work better if it is built on top of this buff / debuff system.