Skip to content

Mixing with_children() and manual Parent insertion result in random children order #4397

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
djeedai opened this issue Apr 3, 2022 · 4 comments
Labels
A-ECS Entities, components, systems, and events C-Bug An unexpected or incorrect behavior

Comments

@djeedai
Copy link
Contributor

djeedai commented Apr 3, 2022

Bevy version

0.6

Operating system & version

Windows 10 / likely irrelevant

What you did

  1. Add some children with with_children()
  2. Add other children by manually inserting the Parent component

What you expected to happen

Children (they're UI nodes) display in expected order according to FlexDirection

What actually happened

Random order. It seems that children from with_children() are inserted first, followed by any other one from manually adding Parent.

Additional information

Related to, or can be confused with, #1214, which is a different documentation-only bug.

@djeedai djeedai added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Apr 3, 2022
@djeedai
Copy link
Contributor Author

djeedai commented Apr 3, 2022

From Discord:

François 🥷🏻 — Today at 11:12 AM
when you insert the parent component yourself, there's another system cleaning up the hierarchy that's updating the children component of the parent. but as it happens in another system, it's not in the same command queue so ordering is lost

djeedai added a commit to djeedai/ld50 that referenced this issue Apr 3, 2022
@alice-i-cecile alice-i-cecile added A-Transform Translations, rotations and scales and removed S-Needs-Triage This issue needs to be labelled labels Apr 3, 2022
@alice-i-cecile
Copy link
Member

@cart can we get a A-Hierarchy label?

@cart
Copy link
Member

cart commented Apr 4, 2022

Done!

@alice-i-cecile alice-i-cecile removed the A-Transform Translations, rotations and scales label Apr 4, 2022
@JaySpruce
Copy link
Member

Fixed by #17398 (Children is now updated by component hooks instead of a system).

@JaySpruce JaySpruce added the A-ECS Entities, components, systems, and events label May 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events C-Bug An unexpected or incorrect behavior
Projects
None yet
Development

No branches or pull requests

4 participants