public class canonControl : MonoBehaviour {
bool deployed;
void Awake() {
deployed = false;
}
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if((Input.GetButtonUp("Canon")) && deployed == false) {
animation.Play("canon_deploy");
deployed = true;
}
if ((Input.GetButtonUp("Canon")) && deployed == true) {
animation.Play("canon_undeploy");
deployed = false;
}
}
for a reason it is not working, it always play undeploy animation. Can any one please help me.
Thanks for the help
– Terena