activeTerrain.SampleTerrain seems to be returning the same value for all world positions

I have the following code in a FixedUpdate method in a C# ship control class I’m working on:

float heightAboveTerrain = transform.position.y -
(Terrain.activeTerrain.SampleHeight(transform.position) + Terrain.activeTerrain.transform.position.y);

This seems to give a reasonable value the first time it is called in a session, but subsequent calls always return the same value no matter where the ship moves. The terrain itself is based on Perlin noise, initialized before I start moving the ship. I can see hills and valleys, so I’m pretty sure that part is working right, and the ship is definitely moving (transform.position is changing).

For now I’m using:

		RaycastHit hit;
		// By default assume we're above maxHoverHeight. This will force the
		// ship down and allows us to set a low raycast distance.
		float heightAboveTerrain = maxHoverHeight + 1.0f;
		if(Physics.Raycast(transform.position, Vector3.down, out hit, 100))
		{
			if (hit.collider.CompareTag ("Terrain")) {
				heightAboveTerrain = hit.distance;
			}
		}

It isn’t ideal (it’ll stop working if something else appears between the ship and the terrain) but it works for now.