When i saved this script, unity is giving me errors to add a colon where the semicolon after the ("whatanimation") is. What im trying to do is have an door opener script, where another script has a false variable by default and is attacted to an invisible cube on the floor, but is set to true if the player runs over it. (DOORSWITCH) This script below is attached to the door with an animation made on maya. What am i doing wrong? And should i add an "= true" to after if(DoorOpen.DOORSWITCH) ? Thanks for you answers.
Script
var whatanimation : Animation;
function Update ()
{
if(DoorOpen.DOORSWITCH);
{
animation.Play ("whatanimation");
}
}