Shield absorbtion factor bug? Set to 0 but still absorbs 100% of all damage.

Grannyboy

Active member
I have a melee weapon set up as a katana from demo scene basically with a Shield Action.

When I try and set the Absorbtion factor to 0 it still blocks 100% of incoming damage.
1678464961064.png

In my set up I deduct 10 stamina on each block, so you can see that my character blocked a few hits with factor at 0 but still no damage.

I can replicate this bug in the demo scene as well:
1678465190599.png
 
Good catch!

I was returning 0 damage when the durability attribute did not exist.
Here I changed the line of 136 of the ShieldAction script
Code:
// If the shield is invincible then no damage is applied to it and the resulting absorption factor should be returned.
if (m_DurabilityAttribute == null) {
    return amount * (1 - m_AbsorptionFactor);
}
This will be available in the next update
 
I think I was to quick to set this post to "Solved"!

Im currently trying out the shield with adjusted code and absorbtion set to 0 but the character still blocks 100% of the damage. Please see this video from my scene and note the shield absorbtion is set to 0 in the inspector:
 
Interesting, I can't seem to replicate the issue.
All I can recommend is trying to step through the code by setting a break point on line 115 of the ShieldAction. That should help you identify why it returns 0 damage.
If it doesn't even enter the "Damage" function of the shield then you might have something else somewhere that is causing the damage to go to zero
 
Top