I have a problem with the rotation of my character, when rotating my character, only that by turning the grid and not the capsule collider.
show the images here:
and my code
var tempDir1 = new Vector3(objetivo.transform.position.x,0,
objetivo.transform.position.z);
var tempDir2 = new Vector3(transform.position.x,0,
transform.position.z);
var dir = tempDir1 - tempDir2;
var rot = Quaternion.LookRotation(dir, Vector3.up);
transform.rotation = Quaternion.Slerp (transform.rotation, rot, Time.deltaTime * 20);
transform.rotation.x=0;
transform.rotation.z=0;
dir.Normalize();