I have the following code setup so that when I click on my door it plays the animation that is on it the problem lies in the fact that I would like two animations. One for opening the door and one for closing the door. But if the door is already open I don’t want it to play the open animation again, I want it to play the close animation.
Here is my code:
void OnMouseDown()
{
animation.Play();
}