Hey there!. Im having problem with my script. what the script does is that it displays a icon when you are aiming on the " door " and that works just fine and opening also. the thing Im trying to add to the script that gives me problem is animation reverse for closing the door. it gives me a error at line 41 saying that " = " is incorrect. isnt that how it suppose to be ?
function Update()
{
var hit : RaycastHit;
//check if we're colliding
if(Physics.Raycast(transform.position, transform.forward, hit, rayCastLength))
{
showSymbol = true;
//with a door
if(hit.collider.gameObject.tag == "doorl")
{
if(Input.GetKeyDown("e"))
{
//open the door!
hit.collider.gameObject.animation.Play("doorleft");
}
}
else
{
{
hit.collider.gameObject.animation.Play("doorleft").speed=-1f;
}
}
//Copy and paste the code above and rename the door animation and that's it! You now have another door in your game!
}
else
{
showSymbol = false;
}
}
}
}
}