was wondering why we need to to add a throttle when we could just make the attack on the mouse button click?
public void Attack(CombatTarget conbatTarget)
{
GetComponent<ActionScheduler>().StartAction(this);
target = conbatTarget.transform;
//my code example
var distance = Vector3.Distance(transform.position, target.position);
AttackBehavior(distance);
}
private void AttackBehavior(float distance)
{
if (distance <= weaponRange)
{
GetComponent<Animator>().SetBool("attack", true);
}
}
so is it ok to sort of use our own code or will it cause problems further along the course?
Thanks
Darrin