Hi All,
I am making an attack animation for my game and when you attack, I want it to enable a collider for 0.5f seconds. I have a script that enables it but I am not sure how to disable it after 0.5 seconds…
Heres what I have so far
void Update () {
if (Input.GetKeyDown(KeyCode.J))
{
GameObject.Find("player").GetComponent<Animator>().Play("Attack");
m_Collider.enabled = true;
animator.SetTrigger("attacked");
//Wait for 0.5f seconds
m_Collider.enabled = false;
}
}
thanks, Larry