GameplayAbilitySystem: Accessing private static constructor of existing AbilityTask-Classes

Hi there,

I’m quite new to Working with Unreal Engine 5 and wanted to learn to use the GameplayAbilitySystem (GAS).

When I started to create my first own ability, I wanted to use some of the existing AbilityTasks to save some time. To do so, I tried to access the static functions to initilize the AbilityTasks that are also used in the Blueprints (BP):

UAbilityTask_ApplyRootMotionMoveToForce::ApplyRootMotionMoveToForce(...)
UAbilityTask_PlayMontageAndWait::PlayMontageAndWait(...)

During build the compiler told me thos functions are private access. I only can assume they are made accessable for BP through some reflection magic. Seems like someone forgot the public:-keyword (or they are realy meant to be BP-Use only)

Since the Plugin is open source, I tried to change the visibility in the Header to public, but i dont know how to recompile the Plugin/Engine from source.

Rightclicking the UE5 project in VS and clicking Rebuild did not work.

Also tried to create a kind of gateway subclass that inherit the AbilityTasks, but since the functions are not protected but private, there is no way to access them.

Using Blueprint is out of question here, because I want to work with C++ in this project.

I can’t even use the default constructor or the NewAbilityTask<UAbilityClass_...> function, since all relevant value members are also private access…

Does anyone have an idea of either:

  • access the private static functions
  • rebuild the plugin from source
  • mask the functions, so I can access them publicly

If I can’t find any other solution I guess I just need to copy the AbilityTask-Class or the whole source of the GAS-Plugin into my project and add it to its source this way. But this would be my last resort.

Thanks in advance for any Ideas.