Hello,
I have a problem of opening the Door,
i do not what the problem since Unity gives me no error.
when i put the animation to play Automatically it shows but when i put the Script it does not work, this is my Code:
var target : Transform;
var area: int = 5;
function Update ()
{
var hit : RaycastHit;
if (Physics.Raycast(transform.position, transform.forward, hit, area))
{
if (hit.collider.gameObject.tag == "Gate")
{
hit.collider.gameObject.animation.Play ("O");
print ("Ray Cast On");
}
}
}
the picture is also attached,
what is the problem here??
