-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
A-TransformTranslations, rotations and scalesTranslations, rotations and scalesC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behavior
Description
What problem does this solve or what need does it fill?
The GlobalTransform did not get updated (it should be) when Parent was removed.
What solution would you like?
- Always recalculate the new
GlobalTransformthenset_if_neq.
if transform_changed {
*global_transform = GlobalTransform::from(*transform);
} else {
global_transform.set_if_neq(GlobalTransform::from(*transform));
}-
Or use
RemovedComponents<Parent>, which may have poor performance if there have so many entities withoutTransform. -
Or use
Removedchange detection, but does not exist currently.
Query<(&Transform, &mut GlobalTransform, Removed<Parent>)>if parent_removed || transform_changed {
*global_transform = GlobalTransform::from(*transform);
}What alternative(s) have you considered?
none
Additional context
none
Metadata
Metadata
Assignees
Labels
A-TransformTranslations, rotations and scalesTranslations, rotations and scalesC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behavior