Hello,
I’d like to include a mini game inside of my project. A small challenge. I thought it would be easy to realize this with Widgets, but I definitely need collision for it to work. What would be the most suitable setup to display a 2D-Overlay on the players camera without covering the whole monitor? Just creating the sprites in front of the camera will lead to trouble with landscape collision.
one method is to build the mini game somewhere under the level [or in a box] and use a scene capture 2d instead of a normal camera to stream the scene into a material. then set the material to an image in the umg or on a plane mesh/particle depending on whether or not the 2d game should move with the main camera. For the opacity you potentially use scenedepth as the alpha, or use black or some specific color to act as a green screen.
you’ll need to keep an eye on performance as drawing to a render target as well and transparency have a cost. you’ll want to stop drawing to the texture if the minigame isn’t in use.
another option is setting up custom collisions so the main and mini game don’t interact.
potentially you could disable the depth test on the materials in the minigame so it doesn’t clip into the main game, but that depends on the nature of the minigame.
This sounds absolutely doable. I will try it out. Thank you very much.