Get children components hierarchy returns random order

I need to get the list of components in order of hierarchy, but seems that depending on if I place the actor in world at runtime or within the editor the returned order is different. It´s always the same order, but not the one shown in the blueprint editor.

Someone knows why may be happening or how to make another aproach to get them in the desired order?

Thank you,

  • Nesjett

Make array out of them on Begin Play. Would that work?

Thank you for your reply Everynone.

Seems that this is not solving the issue, but I found something that was messing around (I was calling the same function in begin play after calling it in constructor too)
Solving that generates almost the expected result (I still dont know why, buecause in theory, executing this function more than one time should return the same results)

Anyway, I think that maybe “Get children components” doesnt cares at all about the hieraichy.


  • Nes

Glad to hear you almost solved it. I fail to see why adding components to an array would mess up your order, though. Since you manually order them.

Most nodes that GetAllOfSomething do not really care about the order, unfortunately. :expressionless:

There should be a way of getting the “id” or “order” of each component, atleast this way we could do it manually. Maybe is it possible from code but not from blueprints…?

You could tag them, get all, sort by tags.

Yes, but this way is not really a “clean” way plus I already use tags for other thing so I prefere not to mix them and stay as clean as possible.

Thank you for your suggestion :slight_smile: