Docs
Helper Methods

Helper Methods

Additionnaly, UGBAAttributeSetBlueprintBase defines a few custom helper intended to be used when implementing the AttributeSet events / methods described earlier.

GetAttributeValue()

Method description

Returns the current (as opposed to base) value of an Attribute.

💡

This method acts as a simple proxy towards UAbilitySystemBlueprintLibrary::GetFloatAttributeFromAbilitySystemComponent() with the ASC returned from GetOwningAbilitySystemComponent()

Parameters

NameTypeDescription
AttributeFGameplayAttributeThe Gameplay Attribute we want to get the current value
bSuccessfullyFoundAttributeboolReturn value indicating whether the value was retrieved successfully (false if owning ASC is invalid or if the AttributeSet the input Attribute belongs to is not granted)

GetAttributeBaseValue()

Method description

Returns the base (as opposed to current) value of an Attribute.

💡

This method acts as a simple proxy towards UAbilitySystemBlueprintLibrary::GetFloatAttributeBaseFromAbilitySystemComponent() with the ASC returned from GetOwningAbilitySystemComponent()

Parameters

NameTypeDescription
AttributeFGameplayAttributeThe Gameplay Attribute we want to get the base value
bSuccessfullyFoundAttributeboolReturn value indicating whether the value was retrieved successfully (false if owning ASC is invalid or if the AttributeSet the input Attribute belongs to is not granted)

SetAttributeValue()

Method description

Sets the base (as opposed to current) value of an Attribute.

💡

You'll get a warning if owning ASC is null, and an ensure error if the AttributeSet the input Attribute belongs to is not granted.

Parameters

NameTypeDescription
AttributeFGameplayAttributeThe Gameplay Attribute we want to set the base value
NewValuefloatFloat value to set

ClampAttributeValue()

Method description

Clamps the Attribute from MinValue to MaxValue

💡

You'll get a warning if owning ASC is null, and an ensure error if the AttributeSet the input Attribute belongs to is not granted.

Parameters

NameTypeDescription
AttributeFGameplayAttributeGameplay Attribute to clamp the value
MinValuefloatThe lower bound float to clamp the value within
MaxValuefloatThe higher bound float to clamp the value within

GetOwningActor()

Method description

Gets information about owning actor.

Return value

AActor* usually representing the OwningActor of the ASC.

GetOwningAbilitySystemComponent()

Method description

Returns the Ability System Component of the Owning Actor.

Return value

UAbilitySystemComponent* of the Owning Actor.

GetActorInfo()

Method description

Returns the Owner's Ability System Component cached data about the owning actor that abilities will need to frequently access (movement component, mesh component, anim instance, etc)

Return value

FGameplayAbilityActorInfo representing the ActorInfo of the Owning Actor.

💡

You'll get an Error if we were unable to get back the ActorInfo cached pointer, and result will be a default FGameplayAbilityActorInfo with none of its member properly populated.

HandleRepNotifyForGameplayAttributeData()

⚠️

This method is meant to be used in the context of a RepNotify Blueprint implementation for an Attribute.

Method description

To be called from Blueprint rep notifies for a given Gameplay Attribute Data member variable.

Meant to provide the same prediction capabilities of GAMEPLAYATTRIBUTE_REPNOTIFY(UMyAttributeSet, Attribute, OldAttribute) macro that is usually called from within a C++ AttributeSet rep notify handler.

Parameters

NameTypeDescription
InAttributeconst FGameplayAttributeData&Attribute Name - must match the rep notify attribute name

HandleRepNotifyForGameplayClampedAttributeData()

⚠️

This method is meant to be used in the context of a RepNotify Blueprint implementation for an Attribute.

This is exactly the same as method as HandleRepNotifyForGameplayAttributeData() above but taking a FGBAGameplayClampedAttributeData input parameter instead.

Method description

To be called from Blueprint rep notifies for a given Gameplay Attribute Data member variable.

Meant to provide the same prediction capabilities of GAMEPLAYATTRIBUTE_REPNOTIFY(UMyAttributeSet, Attribute, OldAttribute) macro that is usually called from within a C++ AttributeSet rep notify handler.

Parameters

NameTypeDescription
InAttributeconst FGBAGameplayClampedAttributeData&Attribute Name - must match the rep notify attribute name