I would like to draw my HUD as an Texture so it gets drawn onto my Wristwatch, (e.g Image)
I cannot find anything useful on how to properly do it. Can anyone help me?
3D Widgets
But 3D Widgets don’t properly support lighting and emissive and all that suff, or do they?
You may have a hard time especially if you want it to be semi-transparent
Instead of using Widget on that - why not setting up a ‘helper BP’ on top of the watch?
You will be able to achieve same/similar effects and have full controll over it
how exactly do you mean that? what exactly is the Helper BP doing? I mean i want to draw my Health etc. inside the Widget, so do you mean i calculate all of that inside my Watch BP and then just give the information into the widget?
Helper BP is just a name, it’s a Custom Blueprint that will help you finish your watch, it may help spawning, calculating or whatever you need it for - I just called it that way
Same if you hear Master BP - still custom BP but Master for all upcoming Children of the BP
Anyway
Normal Widget = 2D Widget, if you want it to be drawn in 3D Space = you need 3D Widget
The ‘helper bp’ will just sit on top of the Watch, read information from your Player to maintain its behavior
If HP indicator is a rotating pointer/arrow - just adapt rotation to HP (100% HP = 100% Rotation of some degrees (f.ex. 270) and 0% HP = 0 Rotation)
If HP is just a color field on your Watch - maintain RGB Values of a Material
If your Watch should show lives - simply add something that represents it - hearts or anything you like and whenever you loose one - remove one
And it’s gonna sit on top of your Watch
It depends on you - advising that way cuz you don’t like 3D Widgets apparently
This watch looks like it’s made with materials not with widgets. Materials can have textures, can be emissive and have translucency etc.
They can also be controlled from blueprint with either MaterialParameterCollections or DynamicMaterialInstances.
Yup, that’s totally true
And the Watch probably has already Material Slots for all those colored places (or is just a single image?)
If you have every part of the Watch separate from Material side - you can make custom Materials with Material Parameters you are able to control from BP’s (google for Dynamic Material, Scalar Parameters, Vector Parameters)
My plan was to just have a material slot for the display and then just draw the Hud onto that instead of my viewport. but i cant get my texture to apply properly
Then like said - 3D Widgets, I see no other option if you want this setup
3D Widgets don’t properly support lighting and emissive and all that suff, or do they?
Tbh no clue, but for everything you make a Material so probably making it the correct way is not gonna give any lighting issues but may be hard to do it well-looking
alright, then i will do it like that. Thanks for the help
The thing is that you cannot draw a 2D Widget onto 3D Space without 3D Widgets
3D Widget uses a Plane and draws your Widget - if you make the Materials correctly it shouldn’t give you much issues
If you are a professional coder, you can see this plugin: GitHub - pafuhana1213/RenderWidgetToTarget
It seems that the author has given up to maintain the plugin since 4.25, so you need to compile the plugin for your project.
Maybe I can maintain the plugin to the latest engine version, but currently I have other work, it will be done months later.
Hey! this is a great finding!
I compiled it for UE 5.2 and tweaked a bit ( removed deltaseconds as I see no sense and forced clear the canvas before pasting again because by default it draws over the previous update, also added a default BG color for the texture)
I have one Issue
Is ok for some static widget but the only way I redraw and get some updated widget state is by adding the widget to the viewport. If the widget is not ‘alive’ in the viewport then its contents wont refresh.
Does anyone has a workaround to force the widget to refresh its contents even if is not in the viewport?
thanks!
here is a video showing the problem: