I want the colour of stairs change according to their position, I tried obj info node with Mix RGB and got the result below, however I want to change the transition position in Z axis, colour ramp didn't help, it only changes the transition power. Stairs are not one objects, they are separete objects using same material in Cycles. thanks
You can use 'object' from the texture coordinate node :
The object output (from texture coordinates) is decomposed into X, Y, Z. Here only Z interests us.
The math node is here to tune the overall scale (real Z variation) to fit into the ramp (0 to 1). I used divide and 12 as value because the stairs here are 12 meters tall.
On right : the stairs made with an array modifier On left : separated objects
Edit : note that the colorramp is not mandatory here. You can short circuit it.