Hi I am just wondering if the solution Sam ran through for this lecture has any difference from my solution which was:
void AggrevateNearbyEnemies()
{
RaycastHit[] hits = Physics.SphereCastAll(transform.position, shoutDistance, Vector3.up, 0);
foreach (RaycastHit hit in hits)
{
AIController[] enemies = hit.transform.GetComponents<AIController>();
foreach(AIController enemy in enemies)
{
enemy.Aggrevate();
}
}
}
I suspect Sam’s will have better performance?