Get UTexture from UTextureRenderTarget2D for Minimap?

Hi there,

I don’t know how to go on - it’s always failing. I need to get the UTexture from my Minimap UTextureRenderTarget2D (Target) and set it into the Draw Function. Camera Texture is currently NULL, because I don’t know how to get it from Target. I managed to get a normal Texture by a ConstructorHelpers::FObjectFinder, but my RenderTarget is not a simple Texture, it’s a RenderTarget (Camera with RenderTarget and Texture).Can anyone help me?

Here is my HUD.h:

	/** Camera Texture */
	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = HUD)
	UTexture2D* CameraTexture;

	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = HUD)
	UTextureRenderTarget2D* Target;

Here is my HUD cpp:

    AHUD::AHUD(const class FPostConstructInitializeProperties& PCIP) : Super(PCIP)
    {
        ConstructorHelpers::FObjectFinder<UTextureRenderTarget2D> TargetObj(TEXT("/Game/Textures/Cards_Texture"));
        Target = TargetObj.Object;

            **CameraTexture = ???**
    }

    void AHUD::DrawHUD()
    {
        Super::DrawHUD();

        this->DrawTexture(CameraTexture, 20, 20, 256, 128, 0, 0, 1, 1, FLinearColor::White, BLEND_Opaque);
     }

Thank you a lot in advance!!

I actually found out, that the UTextureRenderTarget2D is a UTexture (UTexture is second parent). Is it possible to cast it to a UTexture?

Could try

CameraTexture = Cast<UTexture2D>(Target)

Casting worked for me, but I also had to include the Engine.h header in my .cpp file.