keep getting this error after “launch”, but in simulation everything works perfect, i get every single string from array with no exception. Heres code:
TArray<FString> APlayerController::GetLocalizedTextFromFile(FString filename)
{
FString FilePath;
TArray<FString> TextLines;
switch (CurrentLanguage)
{
case Language::Russian:
FilePath = (FPaths::ProjectDir() + "Content/Localization/" + filename + "Russian.txt");
break;
case Language::English:
FilePath = (FPaths::ProjectDir() + "Content/Localization/" + filename + "English.txt");
break;
default:
FilePath = (FPaths::ProjectDir() + "Content/Localization/" + filename + "Russian.txt");
break;
}
FFileHelper::LoadANSITextFileToStrings(*FilePath, NULL, TextLines);
return TextLines;
}
void FSkills::UpdateSkillWidgetName(APlayerController* controller, Skill::Type skill)
{
FString namestring = FString::FromInt(skill) + ", " + controller->GetLocalizedTextFromFile("SkillNames")[skill];
controller->SetSkillWidgetName(namestring);
}
there is 58 lines in text file, and when i simulate i get 58 words from TextLines array, but when i “launch” or “package project” i get this error when im trying to access any index from 0 to 57.