Widget component GetRenderTarget() coming back null

My assumption is that widget components automatically render to a separate texture by default. Do I manually need to set it up in blueprint to render to a separate render target?

I ask because when I try to grab the render target off the widget component it comes back null.

I figured it out - The widget was not visible so it wouldn’t create or draw to its render target.

How did you make the widget ‘visible’?

I have the same issue, but in my case it is set to visible…I am using C++, so I can set Widget->SetVisibility(newState)

If I drag my script in, I can actually see the Widget. But, if I press play, it does not render…quite strange

Update: If I drag in the Script, it works, if I drag in the parent blueprint, it doesn’t…

Can anyone elaborate on this topic? I have a 3D widget that’s clearly visible in the viewport, yet it’s GetRenderTarget() is still empty.

If you’re widget is off screen you have to have “Tick when offscreen” enable/set to true.

They by default disable rendering it if it isn’t going to be seen.
But in order to update the render target it needs to be ticking.
So if you make it invisible by setting its visibility flag to false or have it offscreenn without the “Tick when offscreen” enable then you will get null for “Get Render Target”.


Alternatively (not tested) you can tell it to manually draw when you know your widget has updated so you don’t have it tick all the time and you don’t have to fetch the render target every tick either.

This information helped a lot!
Thank you!

When connected to begin play, the message ‘Not Valid’ was displayed, but when I added a little delay, it worked normally after adding the above.