I’m trying to make a simple script to open and close a door. I’m a noob when it comes to scripting but this is what I have made so far:
function OnMouseDown () {
animation.Play("open");
if (OnMouseDown) {
animation.Play("close");
}
}
But the script does understand that I want to make two different commands. This is what I want to achieve.
When I click on the door the door will open, and STAY open!
When I click on it again the door will close and stay that way until I click on it again.
All help is appreciated.
Thanks.