RaycastHit makes fall my model, There is other Function can I use for this... ?

raycast besides the hit with which one can measure a distance between an object and another, as the raycast hit makes fall on floor my animated model, I don’t wanna used, Someone can help me please !!!
Thanks so much

You can use Vector3.sqrMagnitude or Vector3.Distance for checking distances. Using sqrMagnitude is less intense (good for many objects), Distance is more precise but takes more juice.

If you have a problem with objects falling while using a raycast we’d need to refer to some of your code to help you further.

Hi Thanks everybody, this is the link where you will see what I mean by that fall.

Thanks this is the code

void Update () {

Quaternion targetRotation = Quaternion.LookRotation(target.position - transform.position);

transform.rotation = Quaternion.Slerp(transform.rotation,targetRotation, Time.deltaTime * 4.0f);

RaycastHit objeto;

if(Physics.Raycast(transform.position, transform.forward, out objeto, 6 )){

if(objeto.collider.gameObject.tag == “Player”){

transform.Find(“ArmaEnemiga/Mp5/Canon”).GetComponent().disparando = true;

}

}

}