NullReferenceException: Object reference not set to an instance of an object WanderBehavior.LateUpdate

How to solved this for my soldier at Assets/AIScripts/WanderBehavior.cs:71)

void LateUpdate()

    {

        transform.position = new Vector3(transform.position.x, Terrain.activeTerrain.SampleHeight(transform.position), transform.position.z);

    }

}

Edit

Try dropping Terrain :

activeTerrain.SampleHeight is enough.

Your confusion arises from a misunderstanding of the docs : activeTerrain is a static member of the class Terrain, used to access easily the active terrain.