I am having a problem with the AddHitResult method from the AbilitySystemBlueprintLibrary.
My (simplified) blueprint looks like this:
It’s pretty straightforward - I’m making an EffectContext], then making a HitResult with a bunch of custom values (I set a bunch of stuff to true, and set vectors to (100,100,100) to make it easy to test - normally this would be passed in from a collision event), then calling AddHitResult to add the HitResult to the EffectContext.
But rather than copying the HitResult to the EffectContext, I end up with a HitResult inside the EffectContext with all default values. If I put a breakpoint on the blueprint and inspect it after this node, then I can see that I have a default HitResult with everything set to 0 and false.
Stepping through the C++ code in the debugger, I can see that the expected values make it into AbilitySystemBlueprintLibrary.gen.cpp
You can see in the debugger there that my values are set to 100 as expected. And the highlighted line in the generated code is just calling AbilitySystemBlueprintLibrary::EffectContextAddHitResult. Then if I move up the stack to that method, the values of my struct are reset:
I think this has something to do with the generated code, because if I do all this through C++ only and avoid blueprints, calling UAbilitySystemBlueprintLibrary::EffectContetAddHitResult works correctly.
Would love some pointers in the right direction here, I’m pretty stumped!