Hey everyone, I’m running into a really frustrating issue and could use some fresh eyes. In my game, my character is supposed to brighten his head white whenever I turn on my flashlight but instead it just stays black whenever I either keep the flashlight off or on. I want the head to stay black whenever I keep the flashlight off. I’ve been struggling with this for a while as I just started Unreal Engine and needed some help.
Cannot make much out of your system.
However this is how i would do it:
You have 3 separate tasks:
- make flashlight mesh simulate it is on or off,
- make decal that follows flashlight direction and projects halo on walls
- make dynamic light that lits surroundings
For material to lit that flashlight parabolic mirror (this should be normal not translucend nothing fancy material):
- make material that has two color parameters: Color_ON, Color_OFF, make them accordingly bright and dark
- rest of material is whatever you want.
- make scalar parameter: Brightness,
- use linear interpolate between both colors and drive it from Brightness parameter
- create instanced material out of that above MASTER material
Now you have instanced material, in charavter blueprint on begin play create dynamic instanced material out of it. Use blueprints to change Brightness scalar parameter.
Now you should have flashlight that has changing parabolic mirror brightness.
Next is decal material, make it from decal domain and translucent (better yet additive, but those are harder to tune to what you want, but after all is working experiment with additive)
- for this all is almost same, find nice transparent decal; mask for flashlight.
- do same with colors and Brightness, name those exactly same as in previous material
- now instanced parameter, then dynamic instanced parameter
- since you have exactly same parameters names, it is easier to make sure parameter names are correct
Last thing is light:
- get cone light, make it dynamic, do not overdo with distance. and slap it (attach) to flashlight.
- make flashlight actor, place there mesh, material references, and cone light.
ps.
you can expose all variables to be editable from per instance in editor. Just click that tiny icon next to variable declaration. After that you can change colors brightness and materials without editing blueprint.