I am making a game that, when you click a door, the door opens. When you click again, the door closes.
But i could only make the door open. When i click again, it goes back to the ground and goes up again. I wanted it to close (or play the animation by reverse)
Help?
BTW here is the code im using:
using UnityEngine;
using System.Collections;
public class OpenDoorClick : MonoBehaviour {
void OnMouseDown()
{
gameObject.animation.wrapMode = WrapMode.Once;
gameObject.animation.Play();
}
}