Material Lerp base color based on Camera Z-axis

I am designing a material for a point cloud and I would like to make it so that the points transition from a green color to a brown color as the camera’s position on the z-axis decreases, and vice versa as the camera’s position on the z-axis increases.

I have attached an image of the current material blueprint below.
[ATTACH=JSON]{“data-align”:“none”,“data-size”:“large”,“data-tempid”:“temp_183941_1581982633230_428”}[/ATTACH]

I have already made the material so that the points lerp between green and white as well as invisible and opaque based on the distance between the Absolute World Position of the point and the Camera Position.

The two colors seen in the bottom left of the are the colors I would like the points to lerp between as the camera changes position on the z-axis.

Any advice would be helpful.

Thank you!

Hi, I think you might wanna put this thread here under Rendering, there you will get more replies.

You mean based on the z-position of the camera and not based on the z-velocity of the camera, right?

For based on the position you can do a component mask from your CameraPosition, to mask out the blue channel.
Red channel will be the x-position in the word, green channel is the y position and blue channel is the z position.

If you meant based on the z-velocity of the camera, I would make a new scalar parameter and set that from a blueprint or make a material parameter collection then you won’t need to get a reference to the material to change the parameter.