I just trying to make a new instance of the level. and the code is fairly simple.
#include “WorldGeneration.h”
#include “Unfinished.h”
#include “Engine.h”
#include"Engine/LevelStreaming.h"
float tempTime = 0;
void AWorldGeneration::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
tempTime += DeltaTime;
ULevelStreaming* temp = UGameplayStatics::GetStreamingLevel(GetWorld(), TEXT(“CityGeneration”));
GEngine->AddOnScreenDebugMessage(-1, 5, FColor::Red, FString::SanitizeFloat(tempTime));
if (tempTime > 10) {
temp->bShouldBeLoaded = true;
temp->bShouldBeVisible = true;
temp->CreateInstance(FString(TEXT(“PleasWork”)));
}
}
Now yes I know the var names are bad, but the point of this was to see if I could get the CreateInstance() to work. The rest of the code works perfectly in tell the line temp->CreateInstance(FString(TEXT(“PleasWork”))); is added in. When it is added the code fails to build returning.
1>------ Build started: Project: UE4, Configuration: BuiltWithUnrealBuildTool Win32 ------
2>------ Build started: Project: Unfinished, Configuration: Development_Editor x64 ------
2>Compiling game modules for hot reload
2>Performing 3 actions (9 in parallel)
2>WorldGeneration.cpp
2>[2/3] Link UE4Editor-Unfinished-2719.dll
2>[3/3] Link UE4Editor-Unfinished-2719.lib
2> Creating library D:\Game Creation\Projects\Unfinished\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-Unfinished-2719.lib and object D:\Game Creation\Projects\Unfinished\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-Unfinished-2719.exp
2> Creating library D:\Game Creation\Projects\Unfinished\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-Unfinished-2719.suppressed.lib and object D:\Game Creation\Projects\Unfinished\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-Unfinished-2719.suppressed.exp
2>WorldGeneration.cpp.obj : error LNK2019: unresolved external symbol “public: class ULevelStreaming * __cdecl ULevelStreaming::CreateInstance(class FString)” (?CreateInstance@ULevelStreaming@@QEAAPEAV1@VFString@@@Z) referenced in function “public: virtual void __cdecl AWorldGeneration::Tick(float)” (?Tick@AWorldGeneration@@UEAAXM@Z)
2>D:\Game Creation\Projects\Unfinished\Binaries\Win64\UE4Editor-Unfinished-2719.dll : fatal error LNK1120: 1 unresolved externals
2>UnrealBuildTool : error : UBT ERROR: Failed to produce item: D:\Game Creation\Projects\Unfinished\Binaries\Win64\UE4Editor-Unfinished-2719.dll
2>Total build time: 16.31 seconds (Local executor: 0.00 seconds)
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets(44,5): error MSB3075: The command ““D:\Game Creation\UE_4.19\Engine\Build\BatchFiles\Build.bat” UnfinishedEditor Win64 Development “D:\Game Creation\Projects\Unfinished\Unfinished.uproject” -WaitMutex -FromMsBuild” exited with code 5. Please verify that you have sufficient rights to run this command.
2>Done building project “Unfinished.vcxproj” – FAILED.
========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
This is in a public AActor, if there is something else that I should use please let me know any help would be appreciated.