Umbral lamp Calculate desired cone radius based on distance

Good evening everyone. I’ve implemented the lamp system from Lord of the Fallen. A lamp that allows you to see the world of the dead while in the world of the living. Everything works very well.

But I still have one last problem to solve. I have an invisible cone created in the material. It’s not a static mesh. It has an infinite length and extends from the player, as shown in this image.

The radius is calculated in my character’s blueprint. I use a line trace by channel, which allows me to obtain the distance from the object in the world of the dead.

Currently, the further away an object is, the larger the radius. Conversely, the closer I get to the object, the smaller the radius becomes. In reality, it’s not the radius that’s modified. It’s a cone.

Do you know what calculation would allow me to obtain a constant radius? In other words, whether the line trace touches an object at 10m, 20m, or 1m, I need my desired constant radius to always be the same size. It’s the radius that must adjust with distance so that I obtain a constant desired radius regardless of the object’s distance.

The desired constant radius equals the size of the “window” created by my lamp that allows me to see into the world of the dead.

Please

I’m adding some information because it’s a little more complicated than that. Here’s the main part of the material for the cone.

A good value for my desired constant radius is 32.3 at a distance of 500. But with this material, 30 in cone radius equals 0. So it’s invisible. Above 30, the cone expands, but at 75, the cone shrinks.

Please, I need help. I’ve been trying random calculations for a while now, but I’m having no luck…

Really no one to help me with this calculation? Please