Interactive HUD to change Color and activate Light

Hi everyone,

I’m trying to create a simple level with one object, 3 lights and 1 camera that turn around the object.
I already create a BP Character for the camera and a Widget Blueprint for the HUD.
I based my script on the UE4 tutorial for HUD (UMG UI Designer Quick Start Guide | Unreal Engine Documentation), so my folder is organized like this:
Content
->MyLevel
->Assets (one asset)
->Materials (one material)
->BluePrint (HUD)
->BPCamera (CameraCharacter)
->Textures (four textures)

To begin with the HUD BP, I’ve got 2 vertical box, one contains sliders and the other, 2 checkbox. And I’ve got a horizontal box with 1 checkbox. The event graph is simple, it’s just to make the HUD visible.


Then, my BP for the camera is pretty simple too. I’ve got a camera attach to a spring arm so that we turn around his pivot and not the one from the camera and my script got two functions:
• rotate using the camera, if the left click is pressed
• zoom in or out

46881d78103aa0436b6516bf01a4686e644e2552.jpeg
5b6c50649bb92718fbc6563809459acdb175ccf7.jpeg

For now, I’ve got a bool for the two lights Fill and Rim (don’t want to turn off all the lights), and 3 float for the R V B sliders to change the color of the material. I manage to bind the two checkbox Rim and Fill in my BP HUD to the bool and I can’t manage to create a condition that will make turn off the visibility of the light, I want.

I’m more a 3d artist than a programmer, but I’ve been trying ll day to get it work but I can’t manage to found how to do it, can someone please help me, it’s very frustrating to block here.

Thank you :smiley:

1 Like

Nobody can help me solve this problem ? I’m sure it’s not something really difficult but like I said, I’m a beginner in scripting and I can’t get it work.

I try to make differents sketches to figure it out and I know I have to get my variable (for ex RimLight) from the HUD and change it when I change the statuts of the checkbox with Toggle Visibility, but I can’t manage to do that.

1 Like

Finally, I found how to do it with the change of color for the material and it much simplier that I fought (but when I see the the time in took me, it’s a joke :p), you have to:

• create a HUD with the 3 sliders (Value, Desaturation, Value)
• create custom events from these sliders
• create a Material Parameter Collection with 3 scalars output
• go back to the HUD and connect Exec/Value output to a “Set scalar parameter value” and in the “Collection” entry, select your Material Parameter Collection

and voila !

1 Like

Thx bro :slight_smile: