Construct 3 r419

You're viewing a single comment in a conversation. View all the comments
  • 2 Comments

  • Order by
    • [-] [+]
    • 1
    • Ashley's avatar
    • Ashley
    • Construct Team Founder
    • 1 points
    • *
    • (1 child)

    It does trigger for single instances - an instance without any children still counts as the root of a hierarchy, as it has no parent, and so 'On hierarchy ready' still triggers for it after 'On created'. It doesn't trigger for children, as then we have to decide what sequence to trigger in: top-to-bottom, bottom-to-top, or some other sequence, and whatever we choose, someone will need some other sequence. Therefore it only triggers for the root of the hierarchy, and you can then initialize children in whatever sequence is best for your project.

    • I am not a fan, this doesn't solve the problem to me then.

      The issue is that the root node may not be known and will change all the time because I am using hierarchies often as modular pieces that can then be attached to other hierarchies. I for example have the same hierarchy once used on its own but in another case I add it as a child to an anchor object, so the on hierarchy ready is not useful again. Cases like these are everywhere as a hierarchy might be a module that is used inside other more complex hierarchy and I want the same init logic to work.

      If it was called in reverse tree order (from leaf to root) the rule all children of the node the trigger ran on had their init already will be true.