I have made a list of gameobject. These gameobjects each has attached script called card. Now i have some id and i want to get the card from that list so that gameobject.card.id is the same as id that i have at the beggining.
If you have a list of GameObjects that have Card components then why not just store the list of Card components themselves? Then you could do this alternately
You were wrong. Because if it cannot find the component, then one isnāt on the GameObject, and you donāt have a list of gameobjects with āCardā components on them.