GAS GameplayEffect Component - Chance to Apply

Hello!

I have a small problem about “Chance to Apply this Effect” Component, so by default you set up chance by scalable float, but I want to edit this by “Set By Caller” - base on weapon accuracy derived from data asset. Any one have this kind of problem? maybe you found out the workaround?

I’ve tried create the Gameplay Effect Component in C++ and copy functionality from chancetoapplythiseffect source, but how to change FScalableFloat to SetByCaller?

Thanks in advance!

You can check the code of UChanceToApplyGameplayEffectComponent, it’s pretty simple to follow
Make either a child class of it or just follow the same logic to create your own component that is instead reading from SetByCallerMagnitudes. All you have to do is override CanGamplayEffectApply() basically