Set Attribute Modifier for an Ability at runtime?

Arlo

New member
Hi there!
Is there some way of modifying an ability's Attribute Modifier amount while the ability is running?
Directly setting the m_AttributeModifier.Amount won't work, it's only taking the amount from when the ability starts. Changing the m_AttributeModifier.Amount in the Ability's Update() won't work either : /
 
What update mode do you have set? If you have the attribute continuously updating then when you modify the amount it will take that new value. However, if the attribute fires only once when the ability starts then you will need to manually fire it again when you want the updated attribute to take effect.
 
Hi Justin!
Thanks for the answer, but this doesn't seem to be the case because the attribute is already set as autoupdate.

I'm trying to make the FreeClimb ability to only consume stamina if moving, but remain while in idle. Just for testing I added "m_AttributeModifier.Amount = 0;" directly in Update to check that it is set to 0, but it isn't until you reenter the ability. That is, when setting the amount to zero it keeps consuming stamina, but if you stop climbing and climb again then it doesn't consume anymore. So it's working like the amount is being set at the ability start even when the attribute is set to auto update : /
 
For the auto updating amount you should use AutoUpdateAmount instead of just Amount. Amount is used when the ability starts, and AutoUpdateAmount is used every update.
 
Top