fix(engine): silence B0004 by adding Transform to ModalScrim
Build and Deploy / build-and-push (push) Successful in 3m51s

ModalCard carries Transform (for its 0.96→1.0 scale entrance animation),
which auto-inserts GlobalTransform. Bevy 0.18's on_insert hook on
GlobalTransform fires B0004 when the child has GlobalTransform but the
parent does not. ModalScrim had only Node (which gives InheritedVisibility
via UiTransform but not GlobalTransform), so every modal spawn triggered
the warning.

Adding Transform::default() to ModalScrim gives it GlobalTransform and
satisfies the hook. UI layout is unaffected because Bevy's layout pipeline
reads UiTransform, not Transform.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
funman300
2026-05-17 22:43:59 -07:00
parent 4aafc0a53d
commit eb6c93fb55
+7
View File
@@ -212,6 +212,13 @@ where
// modal at `Z_PAUSE` (220) in some scenes.
GlobalZIndex(z_panel),
ZIndex(z_panel),
// B0004: ModalCard carries Transform (for the scale animation).
// Bevy's GlobalTransform hook fires B0004 when a child has
// GlobalTransform but the parent does not. Adding Identity
// Transform here gives the scrim GlobalTransform so the check
// passes. UI layout still uses UiTransform; this has no layout
// effect.
Transform::default(),
))
.with_children(|root| {
root.spawn((