#Custom EffectContext simpler way to access no Blueprint Library functions
7 messages · Page 1 of 1 (latest)
Inside the header file you'll need this declared in the custom effect context
static ONELIFEWITHFRIENDS_API
FOneLifeGameplayEffectContext* GetEffectContext(FGameplayEffectContextHandle Handle);```
In the cpp file create a definition
FOneLifeGameplayEffectContext* FOneLifeGameplayEffectContext::GetEffectContext(FGameplayEffectContextHandle Handle)
{
FGameplayEffectContext* EffectContext = Handle.Get();
if (EffectContext && EffectContext->GetScriptStruct()->IsChildOf(StaticStruct()))
{
return static_cast<FOneLifeGameplayEffectContext*>(EffectContext);
}
return nullptr;
}```
This is what it looks like inside my exec calc. You can just call this anywhere you have that EffectSpecHandle available
👍 😎
AuraEffectContext->SetIsCriticalHit(bCriticalHit);```
I just casted at the top of the function like so and used it ^_^