Add object of specific width to a List
I have an unspecified number objects, they all have the same script attached.
Only the width will be different, which I will set in the Inspector.(some will be 0.05f, the others will pe 0.09f ).
How could I Add to a List only the objects with width= 0.05f? They all need to have the same script.
Thanks for helping!
Comment
You could try creating an array that contains all gameobjects that have a width of 0.05f.
Thanks for answering @Cyb3r_$$anonymous$$id ! It was actually easy. I used an if statement . If this is not the right approach please let me know.
if( width == 0.05f)
{
widthList.Add(width);
}