Download

Widget BP for varying camera angles

I’m using a “MiniMap-Widget” to show the level from different angles. I want to be able to switch from one Camera to another at runtime. I was able to achieve the desired result by adding a widget to the viewport and on press Tab remove the existing widget and placing a new one.

Somehow this feels clumsy to me, it seems like instead of creating several widgets that all use their own material which use their own SceneCapture2D, I should have been able to:

  1. **Switch the material within the widget BP, my problem here was that the widget BP does not allow any keyboard events. **
  2. Switch the textures on the material. This seems to only work on actors placed in the level but not on widget BPs.

The solution that I have come up with works and does what I need it to do, however I feel like it’s not the best solution possible. Currently I am using 3 widgets, 1 material and 3 material instances, and 3 Canvas Render Targets. It seems it should be possible to use only one widget, 1 material + instance, and 3 render targets. Which brings up the question of resources being used.

I’d greatly appreciate if anybody would take the time to look at this and maybe shed some light on it.