Problem with GAS: UAbilitySystemGlobals and static functions.

I’m discovering that the static function UAbilitySystemComponent* UAbilitySystemGlobals::GetAbilitySystemComponentFromActor(const AActor* Actor, bool LookForComponent) is being called from many different places in the project with the default of having LookForComponent be false. In practice, this means that any actor will be considered invalid if it doesn’t implement IAbilitySystemInterface, even if it has an Ability System Component attached. This makes the component itself pointless as you are forced to edit the base class no matter what. If LookForComponent is true, FindComponentByClass will be used but all existing calls to it use the default parameter of false.

Is there any way Epic can adjust the plugin to make the LookForComponent default value be configurable? I’d hate to have to duplicate the entire plugin just to toggle this one bool.

I discovered that you can override the UAbilitySystemGlobals class your project uses, but this still does not allow me to edit the default parameter or behavior of a static function.

It’s compiled in with the main binary release, so no you’re kinda stuck. You can always compile UE from source :wink:

But yeah you’re basically expected to use a custom C++ actor class somewhere in your hierarchy. Component search isn’t great for performance, which is why it’s set the way it is.

People say FindComponent is slow, but I’m just not convinced that’s the case. Epic already optimizes their functions incredibly so it cant be more expensive than iterating through six or so components on the object and finding a matching one. Regardless, if performance is a problem I can use the Interface for optimization but it still functions if you don’t have the interface. The current version makes that impossible and with no way to to get that behavior, even with overrides and subclassing.