Damage visualization dummy inconsistently responds to hits

zoicelols

Member
I created a character and checked the AI box during. I added damage visualization to him. I created a single attack animation and some of my animations inconsistently hit the dummy while mostly missing per swing. My character swings straight through the dummy and he doesn't take damage unless it shows him successfully being hit. I don't understand how swapping animations can cause the capability of swinging through enemies with your weapon to occur.

I thought that by putting OnAnimatorItemUse and OnAnimatorItemUseComplete on an animation would make it so that in between that entire time is a hit window. When I actually get the hit to register on the dummy instead of it swinging through, it is always right when I have clicked and never any time after. It seems I can only hit at the exact time OnAnimatorItemUse activates, but not all the way up until UseComplete.

I tested this using the demo scene and a couple animations from the asset store.

I skipped this problem a while back because I couldn't figure it out, but I'm back to it. I'm lost on this.
 
The best way to debug this is to place a breakpoint/log within MeleeWeapon.UseItemUpdate and see if the correct casts are being sent. When the collider is obtruding another object the HitCollider method should be called.
 
Okay when I did that the debug log set off about 25 times per swing, but no reaction from the character being hit.
 
So it looks like the overlap cast is not detecting a collision. Can you debug further to see why the overlap casts aren't detecting the hit object?
 
Approaching it another way, can you tell me how I can reproduce it within the demo scene?
 
1. Drag a model to the scene and create a character while selecting third person combat type and checking the AI Agent box.
2. Add the damage visualization ability to the new character.
3. Create a new melee weapon type and item for the playable demo character Nolan.
4. Set up an attack animation in the animator in FULL BODY from ANY STATE to ATTACK 1 to EXIT.
5. On the new weapon change the equip and unequip events to unchecked and 0 duration.
6. On the weapon have allow attack combos unchecked. Have single hit unchecked. Have use and use complete events checked for wait for animation event.
7. Make the new weapon default.

This is all I have done and Nolan swings through AI created character.

I can get the dummy to react to being hit sometimes if i run around spamming my swing and turning over and over.
 
Last edited:
I was actually polishing this for version 2.2 yesterday and noticed in first person the sword wasn't hitting the objects. I have this improved in 2.2 :)
 
Top