-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed as duplicate
Labels
A-TransformTranslations, rotations and scalesTranslations, rotations and scalesC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorP-HighThis is particularly urgent, and deserves immediate attentionThis is particularly urgent, and deserves immediate attentionS-Needs-InvestigationThis issue requires detective work to figure out what's going wrongThis issue requires detective work to figure out what's going wrong
Milestone
Description
Bevy version
0.16.0-dev (#adbb53b8)
What you did
I ran the following code. It has a hierarchy of 3 cubes: a parent, a child and a grand-child. The parent cube moves up and down and so should the children since their transform is relative to their parent.
- Gist to the full code.
- Relevant code:
commands.spawn((
Name::new("Parent"),
Transform::from_xyz(-1.5, 0.0, 0.0),
Movable,
children![(
Name::new("Child"),
Transform::from_xyz(1.5, 0.0, 0.0),
children![(
Name::new("Grand-child"),
Transform::from_xyz(1.5, 0.0, 0.0),
)]
)],
));
fn mover(mut query: Query<&mut Transform, With<Movable>>, time: Res<Time>) {
for mut transform in &mut query {
transform.translation.y = -cos(8.0 * time.elapsed_secs());
}
}What went wrong
- Expected result: the child and grand-child are supposed to move up and down.
- Actual result: only the child moves. The grand-child doesn't.
It seems transform propagation is broken when hierarchy is deeper than 1.
Additional information
- The issue doesn't happen with Bevy
0.15. - I tried with the old
.with_children(|parent| {})API, same issue. - I tried with a grand-grand-child, it doesn't move as well.
- I tried logging global transforms, grand-child really doesn't move (it isn't a rendering issue).
Screenshot
transform_propagation_issue.webm
Logs
2025-03-14T18:04:22.982318Z INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "macOS 15.3.2 Sequoia", kernel: "24.3.0", cpu: "Apple M1 Pro", core_count: "8", memory: "16.0 GiB" }
2025-03-14T18:04:23.075983Z INFO bevy_render::renderer: AdapterInfo { name: "Apple M1 Pro", vendor: 0, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Metal }
2025-03-14T18:04:23.693242Z INFO bevy_winit::system: Creating new window App (0v1)
2025-03-14T18:04:24.730031Z ERROR bevy_core_pipeline::core_3d::main_opaque_pass_3d_node: Error encountered while rendering the opaque phase InvalidViewQuery
2025-03-14 19:04:24.754 server-16[11203:234118] +[IMKClient subclass]: chose IMKClient_Modern
2025-03-14 19:04:24.754 server-16[11203:234118] +[IMKInputSession subclass]: chose IMKInputSession_Modern
Metadata
Metadata
Assignees
Labels
A-TransformTranslations, rotations and scalesTranslations, rotations and scalesC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorP-HighThis is particularly urgent, and deserves immediate attentionThis is particularly urgent, and deserves immediate attentionS-Needs-InvestigationThis issue requires detective work to figure out what's going wrongThis issue requires detective work to figure out what's going wrong