tranek / GASShooter

Advanced FPS/TPS Sample Project for Unreal Engine 4's GameplayAbilitySystem plugin
MIT License
953 stars 265 forks source link

Batching Suggestion #40

Closed hojjatjafary closed 1 year ago

hojjatjafary commented 1 year ago

Instead of having another ability to run the instant one in batch mode, for example the GA_RiflePrimary, we can batch the abilities when they are activating by input, so we can modify the AbilityLocalInputPressed like this:

if (GA && GA->bActivateOnInput)
{
    if (GA->bBatchActivation)
    {
    FScopedServerAbilityRPCBatcher GSAbilityRPCBatcher(this, Spec.Handle);
    TryActivateAbility(Spec.Handle);
    }
    else
    {
    // Ability is not active, so try to activate it
    TryActivateAbility(Spec.Handle);
    }
}
tranek commented 1 year ago

That's closer to how Fortnite does it and probably Lyra (I haven't looked yet). This project was an exercise in how to do everything with abilities. This project is also iceboxed for now so I won't be implementing it. Thank you for the suggestion!