Greeting everyone.
I am getting the following error whenever i am referring to the ULandscapeInfo
class in my code:
error LNK2019: unresolved external symbol "public: __cdecl ULandscapeInfo::ULandscapeInfo(class FObjectInitializer const &)"
I already added the Landscape
module to the build.cs file as well as LandscapeEditor
, and when i add LandscapeInfo
to the build file i am getting an error that this module don’t exist.
So my question is: ULandscapeInfo
is this class available in UE5.1? (I went through the documentation and found out that it exists, but getting this error is making me ask this question).
Second how should i implement this class to be able to use it in my code?
So far the code looks like this:
landactor = {};
//UGameplayStatics::GetAllActorsOfClass(world, ALandscape::StaticClass(),land);
UGameplayStatics::GetAllActorsOfClass(GetWorld(), AActor::StaticClass(), landactor);
//ALandscape* land1 = Cast<ALandscape>(landactor[0]);
UE_LOG(LogTemp, Display, TEXT("Land number is: %d"), landactor.Num());
//UE_LOG(LogTemp, Display, TEXT("The cast is done"));
for (int i = 0; i < landactor.Num(); i++) {
ALandscape* land = Cast<ALandscape>(landactor[i]);
if (land) {
ULandscapeInfo info = ULandscapeInfo();
info.Initialize(GetWorld(), land->GetLandscapeGuid());
int32 num = info.ComponentNumSubsections;
UE_LOG(LogTemp, Display, TEXT("the bool %d"), num);
/*Uncommenting this will make the error
ULandscapeInfo* landInfo = Cast<ULandscapeInfo>(land);
if (landInfo) {
UE_LOG(LogTemp, Display, TEXT("The cast is done"));
}*/
break;
}