Invoke repeating + add goal distance to neutral behavior

This commit is contained in:
Crizomb 2025-01-15 01:32:30 +01:00
parent bf010f3476
commit ca7ce8e645
4 changed files with 11 additions and 13 deletions

View file

@ -10,12 +10,10 @@ public class AttackSkeleton : AttackHandler
public override bool Attack()
{
if (_timer > 0) return false;
float launchAngle = findLaunchAngle();
//print(launchAngle);
// If target not reachable
if (launchAngle < 0) return false;
_timer = cooldown;
GameObject arrow = Instantiate(arrowPrefab, spawnPos.position, spawnPos.rotation);
ArrowHandler arrowHandler = arrow.GetComponent<ArrowHandler>();