Using a Render Target as an image directly?

Hello, I am creating an in-game map system and I would like to use my Render Target as an Image (Texture) for my map directly. So once you press play and have made changes to the map it should update automatically. I currently have this Solution:

But the problem I have with this is that it creates a NEW texture file each time instead of overwriting the old file. I since learned its impossible to overwrite within Unreal Engine. So now my question is: Is there any easier/other way to show the render target as the map. It doesn’t have to update during runtime, only on pre-construct of the widget, which is where this code also is now. I have already tried using a material instance for the brush since Set brush from Material is a function, but even though this works, on bigger maps like mine this only renders in assets close to the player and when the player fast travels to the top left of the map for example, the bottom right wont be visible at all because obviously, the assets and structures over there don’t have to render in when the player isn’t close to them. So a material instance isn’t a solution for me since the map doesn’t even have to update during runtime, only on pre-construct.

Yes that node Editor Only will only work in the editor and not in shipped version.
You can also export it as .png if that you are trying to do.

Another solution to use render target directly is using it texture rt:

  1. Create RT Texture


  2. From your widget, set your image brush to your rt texture(or inside a material)

  3. From your camera / char bp, using SceneCaptureComponent2D setting

  4. Call an event capture when you switch map to capture the scene.

2 Likes

Thank you very much for this solution!

1 Like

Hey, I was looking at this solution again and how do i set the capture from step 4 ? can you provide a clearer explanation on that step? like when to execute this custom event?

It should usually be in controller or character bp where you have your create widget map.

So for example, inside controller bp:
Event Begin > Spawn Camera:CaptureEvent > Create Widget Map

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.