Skip to main content

Synchronize DNA Listener tags with Gameplay Ability System (GAS)

Overview

The DNA Listener Component is responsible for registering and updating the visual effects, and dynamically controls Niagara System parameters based on gameplay tags.

Even if you use GAS, you need one on your character to use the Gameplay Tag overrides of the DNA Anim Notify and DNA Anim Notify State.

We'll see in this example how to create a child Blueprint of the DNA Listener Component to automatically synchronize with Gameplay Ability System tag management.

It demonstrates the concept of overriding the Gameplay Tag management logic of the DNA Listener. We show this example for GAS, but this can be done with any other Gameplay Tag Management logic.

Synchronize the Gameplay Tags of the DNA Listener Component with the GAS Gameplay Tags

1. Add Ability System Component to the character

Add the Ability System component to the character

2. Create a child Blueprint of the "DNA Listener Component"

Create a child Blueprint of the DNA Listener Component

3. Add your custom GAS-DNA Listener to your character

Add your custom GAS-DNA Listener to your character

4. Listen on any Tag change from the Ability System Component

Listen on any Tag change from the Ability System Component

5. Use UpdateGameplayTags function to synchronize DNA Listener with the ASC Owned Gameplay Tags

Use UpdateGameplayTags function to synchronize DNA Listener with the ASC Owned Gameplay Tags

6. Only use GAS Gameplay Tags

From now on, all the Gameplay Tags applied by the Gameplay Ability System are replicated to the DNA Listener. With this basic setup, Add Gameplay Tag and Remove Gameplay Tag methods won't work correctly because they only add the tags on the DNA Listener, not on the Ability System Component. And their changes will be overridden by the UpdateGameplayTags call in SyncInternalTags custom function. You can either: Only use Gameplay Ability System to manage your tags, and never use the DNA Listener Component Add/Remove tags methods. Or, override the Add Gameplay Tag and Remove Gameplay Tag methods.

Example by overriding the Add Gameplay Tag and Remove Gameplay Tag methods:

Example by overriding the Add Gameplay Tag and Remove Gameplay Tag methods