TextureRenderTarget2D

Hi As everyone remember there was a static method in Unrealscript in TextureRenderTarget2D that simply create new instance of this class. Unfortunately I can not find this Method in UE4 in UTextureRenderTarget2D class. I tried to create new instance of it and initialize it using this code in my Actor constructor class(completely came from my instinct;))


     Renderer = PCIP.CreateDefaultSubobject<UTextureRenderTarget2D>(this, "Target");
     Renderer->InitAutoFormat(1024, 1024);

after that I created dynamic material for my mesh and after that I assigned Renderer to My Texture parameter and after all I assigned Renderer to a SceneCapture2dComponent (*** usual in UDK)

but when i start the map it Raise an exception In File: EngineSourceRuntimeWindowsD3D11RHIPrivateD3D11UniformBuffer.cpp In Line 207 this Code


         for (int32 i = 0; i < NumResources; ++i)
         {
             check(InResources*);
             NewUniformBuffer->ResourceTable* = InResources*;
         }

InResources* is NULL

Any help appreciated thanks


This Thread has been answered in answer hub TextureRenderTarget2D - Programming & Scripting - Epic Developer Community Forums

This Thread has been answered in answer hub https://answers.unrealengine.com/que...arget2d-1.html