bevy/examples/transforms
Nicola Papale 3600c5a340 Remove the GlobalTransform::translation_mut method (#7134)
# Objective

It is possible to manually update `GlobalTransform`.
The engine actually assumes this is not possible.
For example, `propagate_transform` does not update children
of an `Entity` which **`GlobalTransform`** changed,
leading to unexpected behaviors.

A `GlobalTransform` set by the user may also be blindly
overwritten by the propagation system.

## Solution

- Remove `translation_mut`
- Explain to users that they shouldn't manually update the `GlobalTransform`
- Remove `global_vs_local.rs` example, since it misleads users
  in believing that it is a valid use-case to manually update the
  `GlobalTransform`

---

## Changelog

- Remove `GlobalTransform::translation_mut`

## Migration Guide

`GlobalTransform::translation_mut` has been removed without alternative,
if you were relying on this, update the `Transform` instead. If the given entity
had children or parent, you may need to remove its parent to make its transform
independent (in which case the new `Commands::set_parent_in_place` and
`Commands::remove_parent_in_place` may be of interest)

Bevy may add in the future a way to toggle transform propagation on
an entity basis.
2023-01-10 18:55:22 +00:00
..
3d_rotation.rs Spawn now takes a Bundle (#6054) 2022-09-23 19:55:54 +00:00
scale.rs Spawn now takes a Bundle (#6054) 2022-09-23 19:55:54 +00:00
transform.rs Change From<Icosphere> to TryFrom<Icosphere> (#6484) 2022-11-14 22:34:27 +00:00
translation.rs Spawn now takes a Bundle (#6054) 2022-09-23 19:55:54 +00:00