I have been implementing GAS in a project of mine and something is bugging me to no end.
In this youtube video made by unreal, they use the function
AttributeSet = AbilitySystemComponent->GetSet<UGASAbilityDemoAttributeSet>();
Where according to the video and the doc, GetSet
is supposed to return the set if it exists or creates it and then give the newly created set. However, when I use it, it always returns null
and I can't find a difference in my implementation.
What is it that I am doing wrong?
Other Sources
In the docs, they also mention to do the same. I also downloaded and look at the implementation for the new Lyra demo project where it's a lot more complex, but in the end, they, themself, do the same.
Note
I know I can just
MySet = CreateDefaultSubObject<UGASAbilityDemoAttributeSet>("My Set")
To create my set, but the fact that I'm unable to use it like they do bug me.