How do I access the first for each's value in a nested loop?

I would like to accomplish something like:

for each unit in Units:
  debugText = createObject(DebugText)
  debugText.setText(ToString("unit.X()"))
  1. Get rid of the trigger once.
  2. Put the action that sets the text of DebugText straight after the action that creates the DebugText, so it’s in the same event.
  3. Get rid of the Repeat for each instance of DebugText event - that’s going though every DebugText instance in the scene.

Note, that the events you have in the screen snip are getting actioned every frame - each Unit will add about 60 new DebugTexts every second. The quickest way to fix this would be to delete all the DebugTexts before you repeat over all Units. Not the most efficient, but if it’s just for debugging, then it’ll do.