Skip to content
Original file line number Diff line number Diff line change
@@ -1,3 +1,48 @@
- `AnimationPlayer`s can no longer play animations by themselves and need to be paired with a `Handle<AnimationGraph>`. Code that was using `AnimationPlayer` to play animations will need to create an `AnimationGraph` asset first, add a node for the clip (or clips) you want to play, and then supply the index of that node to the `AnimationPlayer`’s `play` method.
`AnimationPlayer`s can no longer play animations by themselves: they need to be paired with a `Handle<AnimationGraph>`. Code that used `AnimationPlayer` to play animations will need to create an `AnimationGraph` asset first, add a node for the clip (or clips) you want to play, and then supply the index of that node to the `AnimationPlayer`’s `play` method.

- The `AnimationPlayer::play_with_transition()` method has been removed and replaced with the `AnimationTransitions` component. If you were previously using `AnimationPlayer::play_with_transition()`, add all animations that you were playing to the `AnimationGraph`, and create an `AnimationTransitions` component to manage the blending between them.
```rust
// 0.13
fn setup(mut commands: Commands, mut animations: ResMut<Assets<AnimationClip>>) {
let mut animation = AnimationClip::default();

// ...

let mut player = AnimationPlayer::default();
player.play(animations.add(animation));

commands.spawn((
player,
// ...
));
}

// 0.14
fn setup(
mut commands: Commands,
mut animations: ResMut<Assets<AnimationClip>>,
// You now need access to the `AnimationGraph` asset.
mut graphs: ResMut<Assets<AnimationGraph>>,
) {
let mut animation = AnimationClip::default();

// ...

// Create a new `AnimationGraph` and add the animation handle to it.
let (graph, animation_index) = AnimationGraph::from_clip(animations.add(animation));

let mut player = AnimationPlayer::default();
// Play the animation index, not the handle.
player.play(animation_index);

commands.spawn((
player,
// Add the new `AnimationGraph` to the assets, and spawn the entity with its handle.
graphs.add(graph),
// ...
));
}
```

Furthermore, the `AnimationPlayer::play_with_transition()` method has been removed and replaced with the `AnimationTransitions` component. If you were previously using `AnimationPlayer::play_with_transition()`, add all animations that you were playing to the `AnimationGraph` and create an `AnimationTransitions` component to manage the blending between them.

For more information behind this change, you may be interested in [RFC 51](https://github.com/bevyengine/rfcs/blob/main/rfcs/51-animation-composition.md).
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
- Users of `#[reflect(Resource)]` will need to also implement/derive `FromReflect` (should already be the default).
- Users of `#[reflect(Resource)]` may now want to also add `FromWorld` to the list of reflected traits in case their `FromReflect` implementation may fail.
- Users of `ReflectResource` will now need to pass a `&TypeRegistry` to its `insert`, `apply_or_insert` and `copy` methods.
`#[reflect(Resource)]` now requires the `FromReflect` trait to be implemented for your resource. This is done by default if you use `#[derive(Reflect)]`, but you structs that opt-out of this behavior will have to write their own implementation. `FromReflect` was added to replace the `FromWorld` requirement, though `FromReflect` is fallible. You may wish to add `#[reflect(FromWorld)]` to your resources to maintain an infallible variant.

Finally, if you use the `ReflectResource` struct you will need to pass a `&TypeRegistry` to its `insert`, `apply_or_insert`, and `copy` methods.
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
Any manually created `GizmoConfig`s must now set the `.line_joints` field.
Line joins have been added for gizmos, allowing for smooth or sharp corners between lines. If you manually created your own `GizmoConfig`, you will have to specify the type of line joins with the `line_joins` field.

The `Default` implementation of `GizmoLineJoint` is `None`, but you may be interested in `Miter` for sharp joints or `Round` for smooth joints.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Any manually created `GizmoConfig` must now include the `line_style` attribute
It is now possible to configure the line style (such as solid or dotted) of gizmos using `GizmoConfig::line_style`. If you manually create a `GizmoConfig`, you will have to specify this field.
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
- Replace `bevy_utils::define_label` imports with `bevy_ecs::define_label` imports.
- Replace `bevy_utils::label::DynEq` imports with `bevy_ecs::label::DynEq` imports.
- Replace `bevy_utils::label::DynHash` imports with `bevy_ecs::label::DynHash` imports.
- Replace `bevy_utils::intern::Interned` imports with `bevy_ecs::intern::Interned` imports.
- Replace `bevy_utils::intern::Internable` imports with `bevy_ecs::intern::Internable` imports.
- Replace `bevy_utils::intern::Interner` imports with `bevy_ecs::intern::Interner` imports.
The `bevy::utils::label` and `bevy::utils::intern` modules have been moved to `bevy::ecs`, as well as the `bevy::utils::define_label` macro as part of an active effort to shrink `bevy::utils`. You will have to update your import statements to use the new paths.
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
`ReceivedCharacter` is now deprecated, use `KeyboardInput` instead.
`ReceivedCharacter` is now deprecated due to `winit` reworking their keyboard system, switch to using `KeyboardInput` instead.

```rust
// 0.13
fn listen_characters(events: EventReader<ReceivedCharacter>) {
for event in events.read() {
info!("{}", event.char);
}
for event in events.read() {
info!("{}", event.char);
}
}

// 0.14
fn listen_characters(events: EventReader<KeyboardInput>) {
for event in events.read() {
// Only check for characters when the key is pressed.
if !event.state.is_pressed() {
continue;
}
// Note that some keys such as `Space` and `Tab` won't be detected as before.
// Instead, check for them with `Key::Space` and `Key::Tab`.
match &event.logical_key {
Key::Character(character) => {
info!("{} pressed.", character);
for event in events.read() {
// Only check for characters when the key is pressed.
if !event.state.is_pressed() {
continue;
}
Key::Space => {
info!("Space pressed.");

// Note that some keys such as `Space` and `Tab` won't be detected as a character.
// Instead, check for them as separate enum variants.
match &event.logical_key {
Key::Character(character) => {
info!("{} pressed.", character);
},
Key::Space => {
info!("Space pressed.");
},
_ => {},
}
_ => {}
}
}
}
```
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
- `ReflectComponentFns`’s `apply` and `reflect_mut` fields now take `EntityMut` instead of `&mut EntityWorldMut`
- `ReflectBundleFns`’s `apply` field now takes `EntityMut` instead of `&mut EntityWorldMut`
`ReflectComponentFns` and `ReflectBundleFns` have been updated to work with `EntityMut`, as compared to the more restricting `EntityWorldMut`. You will have to update your usage of `ReflectComponentFns::apply`, `ReflectComponentFns::reflect_mut`, and `ReflectBundleFns::apply`.

If you just use `ReflectComponent` and `ReflectBundle`, you will not have change your code because `EntityWorldMut` implements `Into<EntityMut>`.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
The `multi-threaded` feature was renamed to `multi_threaded` for `bevy`, `bevy_asset`, `bevy_ecs`, `bevy_render`, `bevy_tasks`, and `bevy_internal`. Please update your `Cargo.toml` if you manually specify Bevy features.
The `multi-threaded` feature has been renamed to `multi_threaded` for `bevy`, `bevy_asset`, `bevy_ecs`, `bevy_render`, `bevy_tasks`, and `bevy_internal`. Please update your `Cargo.toml` if you manually specify Bevy features.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Users should update imports that referenced the old location.

```rust
// 0.13
use bevy::ecs::schedule::{NextState, OnEnter, OnExit, OnTransition, State, States}
use bevy::ecs::schedule::common_conditions::in_state
use bevy::ecs::schedule::{NextState, OnEnter, OnExit, OnTransition, State, States};
use bevy::ecs::schedule::common_conditions::in_state;

// 0.14
use bevy::state::state::{NextState, OnEnter, OnExit, OnTransition, State, States}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
- Some `gizmos.primitive_nd` methods now return some or different builders. You may need to adjust types and match statements
- Replace any calls to `circle_segments()` with `.segments()`
`Gizmos::primitive_2d(CIRLCE)`, `Gizmos::primitive_2d(ELLIPSE)`, `Gizmos::primitive_2d(ANNULUS)`, and `Gizmos::primitive_3d(SPHERE)` now return their corresponding builders instead of the unit type `()`. Furthermore, `SphereBuilder::circle_segments()` has been renamed to `resolution()`.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
When working with gizmos, replace all calls to `.segments(...)` with `.resolution(...)`
All gizmo methods named `segments()` have been rename to `resolution()` in order to be consistent with `bevy::render`.
Original file line number Diff line number Diff line change
@@ -1 +1,29 @@
- Any usages of `gizmos.primitive_2d()` and/or `gizmos.primitive_3d()` need to be updated to pass the primitive in by reference.
`Gizmos::primitive_2d()` and `Gizmos::primitive_3d()` now take the primitive as a reference so that non-`Copy` primitives do not need to be cloned each time they are drawn.

```rust
// 0.13
fn draw(mut gizmos: Gizmos) {
let polygon = Polygon {
vertices: [
// ...
],
};

// Since `Polygon` is not `Copy`, you would need to clone it if you use it more than once.
gizmos.primitive_2d(polygon.clone(), Vec2::ZERO, 0.0, Color::WHITE);
gizmos.primitive_2d(polygon, Vec2::ONE, 0.0, Color::BLACK);
}

// 0.14
fn draw(mut gizmos: Gizmos) {
let polygon = Polygon {
vertices: [
// ...
],
};

// No need to clone the polygon anymore!
gizmos.primitive_2d(&polygon, Vec2::ZERO, 0.0, Color::WHITE);
gizmos.primitive_2d(&polygon, Vec2::ONE, 0.0, Color::BLACK);
}
```

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
- `TouchpadMagnify` has been renamed to `PinchGesture`
- `TouchpadRotate` has been renamed to `RotationGesture `
In a recent `winit` update, touchpad events can now be triggered on mobile. To account for this, touchpad-related items have been renamed to gestures:

- `bevy::input::touchpad` has been renamed to `bevy::input::gestures`.
- `TouchpadMagnify` has been renamed to `PinchGesture`.
- `TouchpadRotate` has been renamed to `RotationGesture`.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
`WinitEvent` has a new enum variant: `WinitEvent::KeyboardFocusLost`.
`WinitEvent` has a new enum variant: `WinitEvent::KeyboardFocusLost`. This was added as part of a fix where key presses would stick when losing focus of the Bevy window, such as with <kbd>Alt + Tab</kbd>. Please update any `match` statements.
26 changes: 10 additions & 16 deletions release-content/0.14/migration-guides/_guides.toml
Original file line number Diff line number Diff line change
Expand Up @@ -257,43 +257,37 @@ areas = ["ECS"]
file_name = "13626_Combine_transition_systems_of_Substates.md"

[[guides]]
title = "Replace `FromWorld` requirement on `ReflectResource` and reflect `Resource` for `State<S>`"
title = "Replace `FromWorld` requirement with `FromReflect` on `ReflectResource`"
url = "https://github.com/bevyengine/bevy/pull/12136"
areas = ["ECS","Reflection"]
file_name = "12136_Replace_FromWorld_requirement_on_ReflectResource_and_refle.md"

[[guides]]
title = "Make some `ReflectComponent`/`ReflectBundle` methods work with `EntityMut` too"
title = "Make `ReflectComponentFns` and `ReflectBundleFns` methods work with `EntityMut`"
url = "https://github.com/bevyengine/bevy/pull/12895"
areas = ["ECS","Reflection"]
file_name = "12895_Make_some_ReflectComponentReflectBundle_methods_work_with_.md"

[[guides]]
title = "Make `from_reflect_or_world` also try `ReflectDefault` and improve some comments and panic messages"
title = "Require `TypeRegistry` in `ReflectBundle::insert()`"
url = "https://github.com/bevyengine/bevy/pull/12499"
areas = ["ECS","Reflection"]
file_name = "12499_Make_from_reflect_or_world_also_try_ReflectDefault_and_imp.md"

[[guides]]
title = "Generalize component reflection to operate on `FilteredEntityRef` and `FilteredEntityMut`, not `EntityRef` and `EntityMut`."
url = "https://github.com/bevyengine/bevy/pull/13549"
areas = ["ECS","Reflection"]
file_name = "13549_Generalize_component_reflection_to_operate_on_FilteredEnti.md"

[[guides]]
title = "multi_threaded feature rename"
title = "Rename `multi-threaded` feature to `multi_threaded`"
url = "https://github.com/bevyengine/bevy/pull/12997"
areas = ["ECS","Tasks"]
file_name = "12997_multi_threaded_feature_rename.md"

[[guides]]
title = "Moves intern and label modules into bevy_ecs"
title = "Moves `intern` and `label` modules from `bevy::utils` to `bevy::ecs`"
url = "https://github.com/bevyengine/bevy/pull/12772"
areas = ["ECS","Utils"]
file_name = "12772_Moves_intern_and_label_modules_into_bevy_ecs.md"

[[guides]]
title = "Implement the `AnimationGraph`, allowing for multiple animations to be blended together."
title = "Implement the `AnimationGraph` to blend animations together"
url = "https://github.com/bevyengine/bevy/pull/11989"
areas = ["Editor"]
file_name = "11989_Implement_the_AnimationGraph_allowing_for_multiple_animati.md"
Expand All @@ -311,13 +305,13 @@ areas = ["Gizmos"]
file_name = "12394_Gizmo_line_styles.md"

[[guides]]
title = "Inconsistent segments/resolution naming"
title = "Rename `segments()` methods to `resolution()`"
url = "https://github.com/bevyengine/bevy/pull/13438"
areas = ["Gizmos"]
file_name = "13438_Inconsistent_segmentsresolution_naming.md"

[[guides]]
title = "Make gizmos take primitives by ref"
title = "Make gizmos take primitives as a reference"
url = "https://github.com/bevyengine/bevy/pull/13534"
areas = ["Gizmos"]
file_name = "13534_Make_gizmos_take_primitives_by_ref.md"
Expand All @@ -329,7 +323,7 @@ areas = ["Gizmos"]
file_name = "13261_More_gizmos_builders.md"

[[guides]]
title = "rename touchpad to gesture, and add new gestures"
title = "Rename touchpad input to gesture"
url = "https://github.com/bevyengine/bevy/pull/13660"
areas = ["Input"]
file_name = "13660_rename_touchpad_to_gesture_and_add_new_gestures.md"
Expand All @@ -341,7 +335,7 @@ areas = ["Input","Windowing"]
file_name = "12868_Deprecate_ReceivedCharacter.md"

[[guides]]
title = "flush key_input cache when Bevy loses focus (Adopted)"
title = "Add `WinitEvent::KeyboardFocusLost`"
url = "https://github.com/bevyengine/bevy/pull/13678"
areas = ["Input","Windowing"]
file_name = "13678_flush_key_input_cache_when_Bevy_loses_focus_Adopted.md"
Expand Down