My game instance has two variables of the same type of structure, meant to be used to track various settings used during runtime:
In my GameInstance constructor, I call a function that sets the variables in SavedDataStruct and DisplayedDataStruct based on an ini config file. One of the variables is a FIntVector which I set to (1167, 664, 0) in the called variable setting function. I confirm it is set properly through logging.
I then try to use the DisplayedDataStruct in my Gamemode’s BeginPlay() function. But it has now become (1024, 768, 0). Beyond the GameInstance constructor, at no point does my code change the FIntVector in DisplayedDataStruct or SavedDataStruct, yet BOTH structure’s FIntVector has changed to (1024, 768, 0).
I have been able to avoid this problem by setting SavedDataStruct and DisplayedDataStruct in my Gamemode’s BeginPlay() function, but that doesn’t help me understand why the problem is happening in the first place.
Why is my structure based FIntVector getting reset to a seemingly arbitrary value after the GameInstance’s constructor?