Ability/Attribute Modifier Bug?

dreycoon

New member
I have an ability that costs 30 stamina that I want to have run for 0.5s always so I have it setup like below
1710244687208.png

The problem looks like when CanStartAbilityInternal runs and passes, the stamina gets subtracted
1710245029007.png

but then Update runs right after and it checks the stamina level again but if it is not above 30, then the ability stops. So the ability starts and stops immediately.
1710245041802.png

Is this a bug? It only happens if the remaining stamina is not above 30 after the ability activates.
 

Attachments

  • 1710244822105.png
    1710244822105.png
    417.5 KB · Views: 0
The problem looks like when CanStartAbilityInternal runs and passes, the stamina gets subtracted
Where do you see CanStartAbilityInternal subtracting the amount? I just see an IsValid check which does not modify the value:

Code:
if (m_AttributeModifier != null && !m_AttributeModifier.IsValid()) { return false; }
 
The subtraction amount happens here which is called on AbilityStarted.
1710252694273.png

The bug happens because Update is ran before the stop time has elapsed on the ability and checks the attribute level too soon
1710252796374.png
 
Top