Transform not propagated for child due to delay of inserting Children
#1807
Labels
A-Hierarchy
Parent-child entity hierarchies
A-UI
Graphical user interfaces, styles, layouts, and widgets
C-Bug
An unexpected or incorrect behavior
In the following code snippet, the
1.5
scale is not applied to the scene:The
transform_propagate_system
only runs if either the parent isChanged
or the child isChanged
.However, in this case the order of operations is
0v0
is spawned (and isChanged
for one frame)0v3
isChanged
for one frame.A
Parent(0v0)
component is scheduled to be added via commands.parent_update_system
is run, but theinsert Children
command is not yet processedtransform_propagate_system
is run.0v3
is stillChanged
, but since0v0
has no children yet nothing happens.0v0
now hasChildren([0v3])
.parent_update_system
is run, nothing to be donetransform_propagate_system
is run. This time there are children for0v0
, but0v3
is not changed anymore, so nothing happens.The problem is "fixed" by either adding a
or removing the
Changed
from transform_propagate_system.It is also fixed by adding
.with_children(|_| {})
to thescene_holder
, because then theparent_update_system
can simply insert to the existing children which works without delay.A simpler repro is here.
The text was updated successfully, but these errors were encountered: