Find index number in an Array of a transform by it's name

Hi,

I have an array which is populated with transforms like this:

var attackerClonesArray = new List.<Transform>();

I am trying to find the index number of a transform in the array by searching for it’s name.

I am getting the transform name like this:

var thisTransformName : String;
thisTransformName = transform.name;

My goal is to then erase that transform from the array. I’ve tried an number of solutions such as index and other stuff but can’t seem to quite get it.

Any suggestions?

Thanks

Paul

do NOT use arrays. use List.

never, ever use arrays in Unity.

as well, once you do use List, you have all these available to you …

you can do it with a couple lines of code