how use AutoMaterial in c++

i created a terrain with procedurallTerrain , now i want apply a material based in height (z) but i don´t know how apply diferrent material per different z range( for example 0-100 , 101-500, 1000- +) . i think the automaterial is the solution but i don´t know work with automaterial in c++

,the idea is created the automaterial in begin game and apply the terrain.

You should use material editor and simply get Z distance from world or object position nodes, and remap those to your preferred ranges and then combine them. You shouldn’t be doing shading with C++.

ok, then i will create a new material with the material editor, i will try , thank you ,

i tried but i don´t know how create the material, in the blueprint material i am lost, have it a tutorial?