AttributeSet Becomes nullptr in AbilitySystemComponent

In my Character class I can verify that the AttributeSet is non-null after initialization.

Then, sometime after initialization, the AttributeSet is null

The AttributeSet is added as follows:

Any ideas why it is being nulled? As an aside, if I’m not mistaken, calling CreateDefaultSubobject with an AttributeSet will automatically add it to the AbilitySystemComponent’s SpawnedAttribute Array and therefore I should be able to retrieve it via “GetAttributeSet”

Playing around some more, it seems to only impact my custom AttributeSet class. When I add a SkeletalMeshComponent, it seems to stay:

In constructor:

In a separate method:

I’ve also removed everything in the c++ code that affects replication

I ended up moving the HealthAttributeSet from the AbilitySystemComponent class to my Character class and calling CreateDefaultSubobject inside of the Character constructor for the HealthAttributeSet. Now the AttributeSet is not null anymore.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.