I’ve seen the question asked several times, but for some reason it always goes mostly unanswered (see links). How can I render the main camera view to a specific section of the screen so that I can use the other area for UI elements?
It’s relatively easy to do in Unity, but I’m not finding a simple, non-hack way to do it in Unreal. Using screen capture or rendering to a 2D UMG element doesn’t make much sense due to the drastic increase in overhead.
There is no easy way to alter the viewport in the way that you describe.
Method (FOV) 1: In your widget Blueprint just add widgets that will block portions of the viewport and adjust your FOV settings on your camera to match the remaining view. (may be hard to get desired results if your screen isn’t centered)
Method (RenderTarget) 2: Have your main camera detach from the player and be moved inside a hollow cube with a material that is unlit and black. Then use the 2d scene capture as your camera and draw it to a render target. You can apply that render target as a texture in a UI material and use that as an image in your Blueprint Widget. (not suggested but will work)
Method (SplitScreen) 3: In your level Blueprint create a player on begin play (make sure splitscreen is enabled in your project settings) then create your widget and add to viewport for player 0. If you have spawn pawn unchecked nothing will render to the second viewport making it black. This will allow you to constrain your main player view horizontally or vertically depending on your preference. (you are limited two screen layouts)
I plan to make a feature request for an option that will allow you to specify where your camera viewport is relative to the window.
Thank you. I believe it is a feature that would prove incredibly useful and look forward to using it. I am going to try the FOV method in the interim. Since the camera isn’t moving much, I might be able to get it to work the way I want it to. again for your input.