-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Child text components created after initial object creation are invisible #18616
Comments
Did this work in Bevy 0.15? Trying to evaluate for the milestone + figure out the root cause. |
It looks like it's a 0.16 thing. I made a minimum version in 0,15 with some required API changes and then another in 0.16 that is as close to the match of the 0.15 version as I could. The 0.15 version worked as anticipated, but both 0.16 branches I made have the same undesired behavior. https://github.com/jansenMurphy/bevy_minimum_text_render_failure_example/tree/bevy-015-version |
Did a bisect:
Looks like this got broken in this commit |
#17579 by @ickshonpe :) Thanks a ton for bisecting: that will speed things up substantially. |
Ah it didn't occur to me there could be a problem with text components, I'll take a look |
Right, got it. If both a child and prent are added at the same time and The problem is the |
…m`. (#18664) # Objective The `visited: Local<HashSet<Entity>>` system param is meant to track which entities `update_contexts_recursively` has visited and updated but when the reparent_nodes_query isn't ordered descending from parent to child nodes can get marked as visited even though their camera target is unset and if the camera target is unset then the node won't be rendered. Fixes #18616 ## Solution Remove the `visited` system param from `update_ui_context_system` and the associated visited check from `update_contexts_recursively`. It was redundant anyway since the set_if_neq check is sufficient to track already updated nodes. ## Testing The example from #18616 can be used for testing.
Bevy version
0.16.0-rc.2
Relevant system information
Rust version: 1.87.0-nightly (6cf826701 2025-03-14)
AdapterInfo
Windows 11 (build 22631) - Multi-window, 2 monitors - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3060 (NVIDIA; 32.0.15.6094) - AMD Ryzen 9 5900X 12-Core Processor (24 threads)
What you did
https://github.com/jansenMurphy/bevy_minimum_text_render_failure_example
With this example code, click 'Menu A' and 'Menu B' repeatedly to add and remove the entities and see how the text in menu B fails to render as expected.
This was as minimal as I knew how to get it:
What went wrong
I think the problem is that when entities with text components are added as children to already-existing ui entities, the text is laid out properly but not rendered.
I was expecting to be able to add child 'menus' with text to a root menu long after instantiating the root of the menu.
Additional information
The dark grey rectangle should be rendering text but is not. It's the appropriate width for the text content

Apologies if this is already an issue; I didn't see it if it was.
The text was updated successfully, but these errors were encountered: