I’m having a problem with my door code:
var myLevel : String;
function Update () {
if(Input.GetButtonDown ("Interact") && function OnCollisionEnter(myCollision : Collision)) {
if(myCollision.gameObject.name == "Player")
Application.LoadLevel(myLevel);
}
}
And it says on line 4 “Unexpected token: myCollision”
and on the same line “expecting (, found ‘OnCollisionEnter’.”
I’m not sure what I’m doing wrong, help is appreciated"