Weird variable name problem when trying to add new Attribute Set & Component to Lyra

I’m trying to add a new Attribute Set and Component to the Lyra Starter Game. This is what I’ve generally done:

  • Made a copy of LyraHealthSet and LyraHealthComponent and renamed it, LyraHydrationSet and LyraHydrationComponent respectively. Renamed some things like ELyraDeathState to fix conflicts.
  • Edited LyraPlayerState to create a LyraHydrationSet object.
  • Edited LyraCharacter to include LyraHydrationComponent. Object is created in the constructor. InitializeWithAbilitySystem is called in OnAbilitySystemInitialized(). UninitializeFromAbilitySystem is called in OnAbilitySystemUninitialized().

My problem is that I named the member variable “HydrationComponent” in LyraCharacter. The variable is initialized in the constructor (I checked that it’s not null), however, in OnAbilitySystemInitialized(), HydrationComponent is null. If I rename the variable to anything else, like HydrationComponentABC, I do not have this problem.

Any ideas of why this is happening?