I would like to accomplish something like:
for each unit in Units:
debugText = createObject(DebugText)
debugText.setText(ToString("unit.X()"))
I would like to accomplish something like:
for each unit in Units:
debugText = createObject(DebugText)
debugText.setText(ToString("unit.X()"))
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.