What’s happening is that when you create a lambda expression (a delegate, which is what the event listener is) and you “capture” or include an outside variable you are actually including a pointer to that variable’s location in memory. In other words, everything you do to the original, outside variable will be reflected in the logic inside the lambda expression. Practically speaking, to get around this you can instantiate a temp variable in your for loop like this:
Button[] buttons = go.GetComponentsInChildren<Button>();
for (int i = 0; i < buttons.Length; i++)
{
int temp = i
buttons*.onClick.AddListener(() => { eventManager.answerSelection(temp); });*
} This way you are creating a temporary variable whose only outside scope is the one iteration of the for loop and so you can use it without fear of accidental external modification.