fn collision_system(mut query: Query<(&mut Velocity, &mut Transform), With<Contributor>>)
{
for (idx, ( l_velocity, l_transform)) in query.iter_mut().enumerate()
{
for ( r_velocity, r_transform) in query.iter_mut().skip(idx+1) // dont check for collisions twice
{
// Check for collision here
}
}
}
}
Ive been playing around with the examples and I wanted to make two objects collide but I dont know how I would resolve the double mut borrow here