Here is a setup I got going:
Currently I spawn an actor at the end of the trace (when it hits “floor”). Actor is pretty big (scale 1) as when it’s at the max distance it appears of a good visible size. However, when it’s near the camera it looks too big. 10% of the original scale should make it look nice when near the cam.
The idea is to scale actor based on the distance from the camera (which is already easy to get). When actor is between red vertical bars (see sketch above; along blue double ended arrow) it should be scaled from .1 to 1 based on the distance. Once it goes closed to the cam or farther from the cam (passed red vertical bars on the sketch, along red arrows), scale should remain constant (using last value).
How do I do that (changing scale value withing the bounds and keeping it as it passes set thresholds in both directions) ?