Making a flashlight. Blinding light when standing near a surface

On this screenshot I have a flashlight setup - a spot light source with intensity 100 and attenuation radius of 2000.
Is there any way to make it not being so blindingly bright when standing next to a surface? I mean, sure I could just lower the intensity, but then it won’t illuminate anything further than couple meters.

So far the only thing I could think of is making it toggle between long-range light and short-range light like some flashlights do irl.

But I’m more curious about other solutions to this problem, if anyone has any ideas.

I’m not exactly sure how light function would help in that particular situation… I’m not really familiar with it’s capabilities.

But thanks for the advice regardless! I’ll look into it.

You have two options.

  1. Use a ray trace. If it hits a target, calculate the distance and lerp the intensity relative to that distance.

  2. Use a light function. Using Light Functions in Unreal Engine | Unreal Engine 5.1 Documentation