You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When debug information for an ability is displayed (third category when showing AbilitySystem debug), CanActivateAbility is called, which then calls CheckCost.
This means that CheckCost gets called on the CDO, so attempting to get a reference to the source object in CheckCost will cause GetCurrentSourceObject to call GetCurrentAbilitySpec, which will not be valid for the CDO.
GI_GameplayAbility line 43 is where I implement override CheckCost in the same way as GASShooter.
I overrode via BP and used a GetCurrentSourceObject node.
GetCurrentAbilitySpec checks IsInstantiated, which detects that it is being called on the CDO, which leads to an assertion failure.
I may be able to solve this for my specific case by just caching the source object when the ability is instantiated instead of calling it during CheckCost.
There should probably be some sort of warning comment above UGSGameplayAbility::CheckCost override to warn people to not call GetSourceObject in their cost checking override function though.
The text was updated successfully, but these errors were encountered:
When debug information for an ability is displayed (third category when showing AbilitySystem debug), CanActivateAbility is called, which then calls CheckCost.
This means that CheckCost gets called on the CDO, so attempting to get a reference to the source object in CheckCost will cause GetCurrentSourceObject to call GetCurrentAbilitySpec, which will not be valid for the CDO.
GI_GameplayAbility line 43 is where I implement override CheckCost in the same way as GASShooter.
I overrode via BP and used a GetCurrentSourceObject node.
GetCurrentAbilitySpec checks IsInstantiated, which detects that it is being called on the CDO, which leads to an assertion failure.
I may be able to solve this for my specific case by just caching the source object when the ability is instantiated instead of calling it during CheckCost.
There should probably be some sort of warning comment above UGSGameplayAbility::CheckCost override to warn people to not call GetSourceObject in their cost checking override function though.
The text was updated successfully, but these errors were encountered: