- Home /
Question by
staryzhelios · Jun 19, 2019 at 06:46 PM ·
animationtoggle
Why my other animations in same animator not animate?
What is wrong??
using System.Collections; using System.Collections.Generic; using UnityEngine;
public class PauseScrollAnim : MonoBehaviour { public Animator anim = null;
public GameObject pausebtn;
public bool toggle = false;
// Start is called before the first frame update
void Start()
{
anim = GetComponent<Animator>();
pausebtn.SetActive(false);
}
// Update is called once per frame
public void PauseScrollUpdate()
{
{
toggle = !toggle;
}
if(toggle)
{
pausebtn.SetActive(true);
//anim.Play("PauseScroll");
Debug.Log("BUKA");
anim.SetBool("isOpen", true); //**working**
}
if(!toggle)
{
pausebtn.SetActive(true);
anim.Play("PauseScrollOff"); **//NOT WORKING**
Debug.Log("TUTUP");
anim.SetBool("isOpen", false); **//NOT WORKING**
}
}
}
PLEASE IF YOU KNOW WHY... ><
Comment