- Home /
Problems RaycastHit
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");
}
}
}
Comment
Your answer
Follow this Question
Related Questions
2D 360 degress platformer example needed 0 Answers
AddForce has no effect on my cannonball. 3 Answers
Connecting SpringJoint2D to Rotating Rigidbody2D With Correct Anchor 0 Answers
isKinematic = true kicks in but physics keep on going for one animation loop. 1 Answer
AddForce to a point of a GameObject, not the center 1 Answer