hi i m new with unity 3d i want to create my own game .but i have same issues with the sliding door i create an animation but it didn’t play when the player is close to the door please help
var rayCastLength = 10;
function Update()
{
var hit : RaycastHit;
if (Physics.Raycast(transform.psition, transform.forward, hit,rayCastLength ))
{
if(hit.collider.gameObject.tag == 'door')
{
hit.collider.gameObject.animation.Play('door_open');
}
}
}