C++ Custom Magnitude Calculation

I have a gameplay effect that is applying base stats and some other effects to create some derived attributes. My Secondary effects are failing their CanCalculateMagnitude checks and I have no idea why. I set the relevant Attribute to Capture in the constructor.

UMMC_StrengthMod::UMMC_StrengthMod()
{
    Strength.AttributeToCapture = URAttributeSet::GetStrengthAttribute();
    Strength.AttributeSource = EGameplayEffectAttributeCaptureSource::Target;
    Strength.bSnapshot = false;

    RelevantAttributesToCapture.Add(Strength);
}

The effect is pretty basic too

Am I missing something in this setup? All I’m getting is

Modifier on spec: Default__GE_StrengthMod_C was asked to CalculateMagnitude and failed, falling back to 0.

I ran into this same problem today as well. My solution was to change “EGameplayEffectAttributeCaptureSource” from Target to Source.

In your case Strength.AttributeSource = EGameplayEffectAttributeCaptureSource::Source;

I haven’t had time to test using “Target” yet but I figured I’d post a possible solution for others that are experiencing the same problem.