Terrain hugging objects (Distance to nearest surface

Hi all im trying to get my head around shaders in UE4 my intention is to have the landscape have a shader that offsets towards objects placed on it.
Before the displacement even needs to be considered is to getting the distance detection working as you can see in the pic this works fine for a plane and a plane only, the other meshes and landscape do not give the provided effect, i dont know why, i am just looking to get that effect on the terrain