# How to stick character to the ground without NavMesh?

Hello, I have an NPC (Animal Pack Deluxe) and a bumpy terrain (MapMagic, infinite map). The problem is the character is not reading the ground and just floats in the initial level. What is the right setup for NPC?
For now I’ve got rigidbody with enabled gravity and “is Kinematic”, animator, AI script (basic wanderer), skinned mesh renderer and non convex mesh collider. It does read the ground when I uncheck “Is Kinematic” and check “Convex”, but I don’t want it to be convex and with unchecked Is Kinematic AI script keeps moving the character when the game is paused. And, if I add NavMeshAgent it also works, but I don’t think that the NavMesh is an option for this map. What can I do, should I use Ray/Sphere-casting to the ground?

If the animal is to expect collisions I would keep it convex, as convex basically makes the outside of the mesh(where colors and images show on object) work for collisions. Assuming you’ll want something like a spear to hit it for a certain amount of damage later on(the spear mesh will also have to be convex).
Can’t say much about is Kinematic, as every time I use that option nothing works.
But true, if you can find a way for the object(ex. Sheep) to determine what the ground mesh height is, then yes,

`````` float distToGround = ( // logic of determining proper height of sheep here.. )
Sheep.transform.position = new Vector3(0, distToGround, 0);
``````

should do what you need it to

So finally I’ve made something that works:

``````private void FixedUpdate()
{
if (Physics.Raycast(transform.position, Vector3.down, out var hit))
{
if (hit.distance > 0.05f)
{
transform.position = new Vector3(transform.position.x, transform.position.y - distToGround, transform.position.z);
}
else if (hit.distance < 0.02f)
{
transform.position = new Vector3(transform.position.x, transform.position.y + distToGround, transform.position.z);
}
}
}
``````