- Home /
Create a component list from other list
Hi, everyone.
I have a list, and I want to create a new list with a specific component of each member of the first list. I'm doing it like this:
List soldierUpgradeableList = soldierList.Select(soldier => soldier.SoldierGO.GetComponent).ToList();
soldierList is List. SomeClass has a gameObject
I have error CS0029. Obviously I can do it without linq, but I would like to know how to do it.
Thank you
Comment
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Combining Items in a single list by comparison 1 Answer
Help with crafting system. 1 Answer
How to Copy a Component if it contains List? 1 Answer
Removing a Component while in a List 1 Answer