Using lookRotation and hit.normal problems with orientation

So i have creatures roaming over a plain with hills. I am using Quaternion.lookRotation to orient their facing direction, and hit.normal is giving me the normals of the plain so the creatures are oriented to the ground. This only seems to be working on one axis at any time. The creatures will either pitch forward, or sidewise, but will not do both at the same time.

you can wander around the hills too if you’d like: http://aylogames.com/wolfireStuff/glidingTestWithFlapping/glidingTestWithFlapping.html

Any clues?

                RaycastHit hit;
				Physics.Raycast(transform.position, Vector3.down, out hit);
				Debug.DrawRay(transform.position, Vector3.up, Color.blue, 2);
				if (Physics.Raycast(transform.position, Vector3.down, 2)) {
					storeNormal = hit.normal;
					//Debug.Log("Normal hit: " + storeNormal);
					Debug.DrawRay(transform.position, storeNormal, Color.green, 2);
				}
				//Apply changes to each child of the game object
				foreach (Transform child in transform) {
					if (moveDirection.sqrMagnitude > 0) { 
						//myAnimation.SetBool("Run", true); //Changes avatar to running state
						var targetRotation = Quaternion.LookRotation(moveDirection, storeNormal); //set target towards direction of motion
						child.rotation = child.rotation.EaseTowards(targetRotation, turnSpeed); //rotate towards the direction of motion
						myRotation = child.rotation;

The use of the hit.normal as the second parameter in the LookRotation() does not orient the object with the ground. It defines the preferred axis of rotation. In addition, there is a lot of situations where an object cannot both be oriented with the ground and look in a particular direction. I’m only guessing how you want this to behave, but you might get what you want by inserting between line 13 and 14:

transform.rotation = Quaternion.FromToRotation(transform.up, storeNormal) * transform.rotation;

If that does not get what you want, then I’d try projecting the move direction down on a plane passing through the character with ‘storeNormal’ as the plane normal. Then use the projected ray in LookRotation().