Apply damage with Kick

timfrench

New member
I wanted my character to be able to kick at anytime, armed or not. So I created a Kick ability with "k" on the keyboard. That works well. I added to my assault rifle as Melee weapon ID 2 (Already had the weapon "butt" melee added). The left leg Hitbox is registered to apply the damage. I have a Target setup with the "Enemy" tag for testing. Melee ID1 applies damage just fine, but the kick never applies damage? (The kick ability is set to ability ID 200 and uses the same kick animations for the Body but setup under Kick in the full body layer and can only be used when not moving or aiming). When in Body mode, the kick registers the damage as expected. I'm thinking it has to do with Animator Audio but since I'm not using the animator states to activate to action I set it to 0 and added the state Name Kick. I've also tried unselecting it. I'm sure I'm just missing some simple setting somewhere that you'll quickly point out???
 

Attachments

  • Screen Shot 2019-12-23 at 10.17.36 AM.png
    Screen Shot 2019-12-23 at 10.17.36 AM.png
    45.8 KB · Views: 6
  • Screen Shot 2019-12-23 at 10.28.43 AM.png
    Screen Shot 2019-12-23 at 10.28.43 AM.png
    85 KB · Views: 7
The best way to debug this is to set a breakpoint within MeleeWeapon.UseItemUpdate and see why the damage isn't being registered. There are a number of conditions that can fail which would prevent the kick from happening and by setting a breakpoint you can see where it fails.
 
Turns out I didn't need to create a Kick ability. Although I was causing the kick, I never actually caused it to trigger a USE state, so naturally no damage was occurring. I now changed this by adding a lower body layer with a lower body mask. I added a kick sub-state using the kick animations from Body, created a USE - Slot 0, Action 2 with a Item State Index of 8. When adding to a melee or shootable weapon I'm ensuring it's it's ID is 2. Now I can counter strike with a Butt or Kick. I only test that the state changed and it equals 8. I don't care about the type of weapon. I'm using keyboard letter "k" to trigger the acton. Seems to be working as planned. Your advise on the UseItemUpdate triggered me to realize I never called a USE!!! Thx.
 
Top