I need to obtain the ability level to do my custom magnitude calculation. However, all I can obtain are attributes. How would you access it from within the magnitude calculation blueprint?
#abilitysystem #UE5-0
Hey @Defohost! Welcome to the Forums!
If you are just looking for the ability level, have you tried any of these three options?
I hope the above solution works for you!
Thanks for your reply! Unfortunately, I am not a C++ developer, but I was able to try that code.
One of them simply returned 0. The other 2 require me FGameplayAbilitySpecHandle Handle,
const FGameplayAbilityActorInfo* ActorInfo which I don’t have access to from the blueprint.
This is the solution:
ModMagnituteCalc
header file
UFUNCTION(BlueprintCallable, Category = "Calculation")
float GetAbilityLevel(const FGameplayEffectSpec& Spec) const;
cpp
float YourClassNameHere::GetAbilityLevel(const FGameplayEffectSpec& Spec) const
{
return Spec.GetLevel();
}
2 Likes