By default, it seems like structs in ue are meant to be passed by value, effectively copying the entire class and all of its data. In my case, I have a data struct that contains everything an NPC needs to function like HP, statistics, inventory, and so forth. I have a centralized array of every CharacterData struct in the game, and when a character is spawned into the world I attach a copy of their data struct to their ACharacter subclass, so the game can do things like process damage or skill checks against them by casting to AMyCharacter and looking for that specific NPC’s CharacterData.
Right now I handle this by passing a copy of the CharacterData struct from the central array to the instance of AMyCharacter created when the NPC spawns, applying any changes to the local version of the struct, then passing it back to the central array when the character despawns. Is there any simple way I can skip this, and simply keep a single, central array of structs that each ACharacter contains a pointer to?