sampling height of terrain when there is more than one terrain in the scene?

I am trying to make an enemy follow the player along the terrain. I know that using Terrain.activeTerrain.SampleHeight(transform.position) will give me the height of the terrain if there is only one in the scene, but if there are more how do I tell it which terrain to pull the height from?

punisher is right, to define the GameObject of the terrain mesh you want to sample the height from, you should raytrace downwards from the player/enemy that you need to measure the height from, you can also use sphereoverlap. You can also get all the terrain positions, from their tag, and compare their distance with the object you want to measure the terrain from, and takes the closest one with the unity distance() function.