I have a generic list of gameobjects “Nodes”, and I need to find an object in that list with a given name. “trigger” is a string, and we basically need to see if any of the gameobjects’ names matches the value of trigger. Working in C# here.
I suppose it would be something along these lines?
foreach (GameObject in Nodes)
{
if (Object.name == Trigger)
{
Debug.Log("Yay");
}
}
Not entirely sure how to phrase that first line though, the foreach loop. Any ideas? Thanks.