Hello,
I am just getting started with Unreal and am following the “Unreal Engine 4x by Example” book. I am having an issue with Visual Studios intellisense where it is incorrectly attributing errors to working code, saying that the function is “inaccessible”.
The code works fine, but the false-errors in the IDE are very annoying. Does anyone know how to fix, or at least suppress these errors?
code snippet:
UStaticMeshComponent* SphereVisual = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("SphereMesh"));
ConstructorHelpers::FObjectFinder<UStaticMesh> SphereAsset(TEXT("/Game/StarterContent/Shapes/Shape_Sphere.Shape_Sphere"));
ConstructorHelpers::FObjectFinder<UMaterial> SphereMaterial(TEXT("/Game/StarterContent/Materials/M_Metal_Burnished_Steel.M_Metal_Burnished_Steel"));
if (SphereAsset.Succeeded() && SphereMaterial.Succeeded()) {
SphereVisual->SetStaticMesh(SphereAsset.Object);
SphereVisual->SetRelativeLocation(FVector(0.0f, 0.0f, -50.0f));
SphereVisual->SetMaterial(0, SphereMaterial.Object); // <--- set material shows an intellisense error
}
screenshot of the error:
I have seen some suggest just turning off error reporting as a whole, but I’m hoping there might be a way to not throw the baby out with the bath water.
Thanks