Hello,
I have made a struct in c++, this struct contains information about worlds in my game, because the player is able to switch worlds instantly and I am using 1 persistent level with sub levels. Then in my game instance class, I have the following TArray:
/*
* Array holding the data of all the worlds, data is set in the game instance BP
*/
UPROPERTY(BlueprintReadOnly, EditAnywhere, Category = "Worlds")
TArray<FWorldData> Worlds;
The contents of this TArray are being coppied to an UnlockManager class which checks if the worlds are unlocked etc.
UnlockManager->PopulateWorldsArray(baseGameInstance->Worlds);
void UUnlockManager::PopulateWorldsArray(TArray<FWorldData> _worlds)
{
Worlds = _worlds;
}
Now, one of the datatypes this struct is holding is the following:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Level Data")
UAnimBlueprintGeneratedClass* DefaultCharacterAnimClass;
Now, when I try to get the current game world (FWorldData struct) in my game mode, read it out in Blueprint and break the struct to get the DefaultCharacterAnimClass pointer variable… My game crashes.
FWorldData AEndlesRunnerGameMode::GetCurrentWorldData()
{
return currentWorldData;
}
All the other contents of the struct read out fine, but getting that one crashes my game, and also, only on IOS. Not on windows, not on Mac, not while PIE.
Somehow when my game crashes, it won’t generate crash log files anymore on the IOS device, so I am kind of in the dark here…
I need that DefaultCharacterAnimClass because the mesh of the player is different in each world, and so I need to change the AnimationInstanceClass of that mesh to the correct animation blueprint so that the character is animated.
I hope this all makes sense to someone and that maybe someone know’s what’s going wrong here.