Change landscape color based on distance

Hello community,
I’m new to Unreal and therefore have very little experience at this point. I’m trying to build a feature for a flight simulator showing terrain only within a specific (horizontal and vertical) range. The idea is as follows:
Outside of range the landscape is invisibile. Inside this range the landscape becomes visibile in green. On top of that getting closer to the landscape the color should change (green-amber-red).
At this point I managed to built a Blueprint for an actor using this logic (see video attatched).


Now I’m trying to transfer this logic to the landscape but I don’t know how. My idea would be creating a material with the states specifics and use it for the landscape.
Can anyone help me here?

You can use a material parameter collection to store the player location in a material-accessible form:


You can then create a simple mask around that location:


Make sure to handle the largest radius first- else it’ll override all smaller circles.

Result:

If you want it to instantly happen to the entire actor like in your video, you can replace the absolute world position node with an ActorPositionWS node. With that, this is your result:

Thanks a lot for the quick help. From here on I know how to proceed.

1 Like