Hello there! I am trying to run a script that allows me to access all instances of a script within the children of an object. To do this, I have tried the following:
//simplified script to pinpoint the issue
private Component hitBoxes;
void Update()
//get hitboxes in object
hitBoxes = GetComponentsInChildren<AIHitbox>();
foreach (AIHitbox hitBox in hitBoxes)
{ //call this function on each instance
hitBox.switchForcePos(true);
}
Thank you in advance!