I don’t see why it won’t apply a cool down to my animation.
using UnityEngine;
using System.Collections;
public class Sword : MonoBehaviour {
[SerializeField]
private float SwordCooldown = 3.0f;
private float SwordTimer;
private Animator Anim;
bool Swing;
void Start ()
{
Anim = GetComponent();
SwordTimer = 0;
}
void Update()
{
//Timer
SwordTimer -= Time.deltaTime;
if (SwordTimer <= 0)
{
//Play Animation when mouse is pressed
if (Input.GetMouseButtonDown(0))
{
Swing = true;
}
else
{
Swing = false;
}
}
Anim.SetBool(“Swing”, Swing);
}
}