Deal damage with an ability

Grannyboy

Active member
I have a kick set up as an ability. The reason why its an ability is because I want to be enable to kick while I have my 2 hand melee weapon equipped. Thats not possible when using the "Body" melee weapon.

So far all my ability do is changing the AbilityIndexParameter so that my kick animation plays. Also I have an event placed in the animation to call StopAbility acordingly:
1652711084336.png


I have a melee hit box attached to my character that I want to use as hit box for my kick as well.
1652711345920.png

Im not sure how to go on about this. How do I script to make my kick deal damage similar to a melee weapon in my hitbox?
 
I would recommend to implement the kick as an item. You only need to add a third item slot for the feet. The demo uses item slot 0 for the body, but you can easily switch it to item slot 2.
 
How would that work with rebinding the kick since Im holding the melee weapon at the same time? I would really like to learn how to deal damage with the ability system since somewere down the line I would like to implement other attacks, magic attacks, charge attacks etc with the ability system.
 
What is your concrete problem? You need to implement the kick as an item with slot ID 2. You also need your animator to use slot ID 2 for the kick. Then you define item states in the item state manager that allow to equip 2 melee weapons and the kick.
There are also magic items so you don't need to use the ability system for that.
 
I would like to use the ability system for different kind of damaging abilities. Lets say a AOE whirlwind ability for example. There must be a way of dealing damage trough the ability system isnt it?
 
You can call Health.Damage within an ability:

 
You can call Health.Damage within an ability:

This is what im looking for! Now my only issue is how to detect the object inside my collider. Since OnColliderEnter dont work, how can I detect my enemy inside my box collider within an Ability?
 
Aha, I had to set the OnTriggerEnter to public override!
Now I know how to proceed. Sorry for being so slow, I have covid and cant think straight. Thanks for the help!
 
Top