I'm doing a script to open my door so I get closer, but the problem is that he is giving this error that I do not know who could help me please?
Error: BCE0019 'RaycastHit' is not a member of 'UnityEngine.Physics'
Below is my code.
function Update () { var hit:RaycastHit;
if (Physics.RaycastHit(transform.position, transform.forward, hit, 7)){
if (hit.collider.gameObject.tag == "porta") {
hit.collider.gameObject.animation.Play("porta_abrindo");
}
}
}