// so we're trying to move towards the quarterback, let's just do that for now. Totally ignore blockers. void Update() { if (mActive) { cBurst.FCalcAcc(refPlayer.transform.position - transform.position); // Need some component that pushes characters that we want to push. if (Vector3.Distance(transform.position, refBlocker.transform.position) < 2f) { cGivShv.FGiveShove(refBlocker.GetComponent <AI_Athlete>()); } } }
void Update() { // 1) get midway between the rusher and the passer. if (mActive) { Vector3 midSpot = refPlayer.transform.position; Vector3 dis = refRusher.transform.position - refPlayer.transform.position; dis /= 2f; midSpot += dis; // get our burst to accelerate us in that direction. cAcc.FCalcAcc(midSpot - transform.position); // for now, just calculate if our rusher is within our sphere of influence. if (Vector3.Distance(transform.position, refRusher.transform.position) < 2f) { cGivShv.FGiveShove(refRusher.GetComponent <AI_Athlete>()); } } }