I want to access a nested MaterialMesh2dBundle for its transform component in order to change the position of a ball on screen. When I try to use a query it throws: error[E0277]: the trait bound MaterialMesh2dBundlebevy::prelude::ColorMaterial: bevy::prelude::Component is not satisfied. I am able to successfully access Position and Velocity.
Should I be accessing the transform independently, despite it being nested in my Ball and MaterialMesh2DBundle bundle? Whats going on here?
fn move_ball(mut query: Query<(&mut Position, &Velocity, &MaterialMesh2dBundle<ColorMaterial>)>,){
for (mut position, velocity, mesh2dbundle) in query.iter_mut() {
position.x = position.x + velocity.x;
position.y = position.y + velocity.y;
mesh2dbundle.transform = Transform::from_xyz(5.0, 6.0, 7.0);
}
println!("moved da ball");
}