Hi there. I want to assign a scene capture cube to a pawn and handing it an existing Rendertarget.
Creation of the CaptureCube works just fne, but I have a Problem refrencing the Texturerender TargetCube.
I ge a compiler Error which don’t get. Since I am quite a noob in c++, maybe someone can explain to me what i am doing wrong.
Thats my code:
//Setup SceneCapturecube
static ConstructorHelpers::FObjectFinder<UTextureRenderTargetCube> Targettex(TEXT("/Game/VehicleAdv/Materials/ReflectionsCapture.ReflectionsCapture"));
Capturecube = CreateDefaultSubobject<USceneCaptureComponentCube>(TEXT("CaptureCube"));
Capturecube->AttachTo(RootComponent);
Capturecube->SetRelativeLocation(FVector(0, 0, 160));
Capturecube->TextureTarget = Targettex.Object;
And Thats the Compiler Error:
Error C:\Program Files\EpicGames\4.7\Engine\Source\Runtime\CoreUObject\Public\UObject\ConstructorHelpers.h(92) :
error C2664: ‘void ConstructorHelpers::ValidateObject(UObject *,const FString &,const TCHAR *)’ : cannot convert argument 1 from ‘UTextureRenderTargetCube *’ to ‘UObject *’
Since Text is a FString and afaik a UTextureTargetRenderCube is part of UObject I can’t find my mistake.