AttributeModifier - EnableModifier(false) doesn't subtract from current value?

LeoLFerraz

New member
Hey, all!
I have a collection of abilities meant to raise a character's base stats according to a roguelite permanent progression system. These abilities simply initialize an AttributeModifier and enable or disable it according to the abilies' state.
They successfully raise the stat when enabled, but won't lower the stat when disabled.
The Modifier.EnableModifier(false) gets called, but my stat remains 'buffed'.

Am I using AttributeModifiers wrongly?
Cheers.1669337334547.png
 

Attachments

  • PPAbility.cs
    2.3 KB · Views: 0

Justin

Administrator
Staff member
When EnableModifier(false) gets called it doesn't reset the attribute value - it just stops the attribute from being auto updated. Is that what you are wanting?
 

LeoLFerraz

New member
Oh, I assumed disabling the modifier would also null out its modified amount. In order to achieve that effect, should I just do Modifier.Amount = 0 then? Or is there a more appropriate way?
 
Top