# Migrating From v0.6 to v0.7

## Bevy 0.19

**Avian 0.7** updates from Bevy 0.18 to [Bevy 0.19](https://bevy.org/news/bevy-0-19/). See [Bevy's migration guide](https://bevy.org/learn/migration-guides/0-18-to-0-19/) for migrating to the new version.

## Move and Slide Intersections

The callback provided to `MoveAndSlide::intersections` now takes a third parameter, `Entity`. This
allows accessing the entity being intersected per callback. Existing calls to this function can
simply ignore the new parameter with `_`.

## `SpatialQueryPlugin` schedule is configurable

Similar to many other plugins, the `SpatialQueryPlugin` now stores a schedule label,
which by default is also passed via `PhysicsPlugins::new`.

## 2D picking works in more 3D situations

PRs: [#982](https://github.com/avianphysics/avian/pull/982)

`PhysicsPickingSettings` in 2D now contains a `z_plane` that determines the world space Z coordinate
of the plane that rays cast from the picking `Camera` intersect, affecting the world space XY coordinates
used when querying for colliders to pick.

This allows 2D physics picking to work properly with cameras using perspective projection
or rotated away from the default forward direction, as long as all pickable colliders
are located at the `z_plane` world space Z coordinate.

The Z component of the `HitData::position` produced when picking in 2D is now equal to `PhysicsPickingSettings::z_plane`,
and `HitData::depth` is equal to the distance along each ray to its intersection point on the plane.

## Physics Debug Gizmo Mesh Visibility

In past releases, `PhysicsGizmos::hide_meshes` forced all meshes to be visible when it is `false`.
In **Avian 0.7**, it instead sets the mesh visibility to `Visibility::Inherited`, which is a more
appropriate default.

This is still not perfect, as it does not fully respect the old visibility value. Doing so
would require caching the old visibility in a separate component. This feature will likely
undergo larger changes in the future, for example favoring `RenderLayers` over `Visibility`
to create a dedicated "debug view".
