hi guys…please help me…i try to use this script for open the door … but its not working… i made animation for door and its work…but this not working…please helppppp !!!
var RayCastLenght = 5;
function update()
{
var hit: RaycastHit;
//check if we colloding
if(Physics.Raycast(transform.position, transform.forward, hit, RayCastLenght)) {
//...with a door
if(hit.collider.gameObject.tag == “door”) {
//open the door
hit.collider.gameObject.animation.Play(“open door”);
}
}
}