use unwrap
This commit is contained in:
parent
889b175daf
commit
edfb0be3c6
1 changed files with 2 additions and 4 deletions
|
@ -43,10 +43,8 @@ fn move_player(
|
|||
direction.x -= 1.0;
|
||||
}
|
||||
if direction != Vec3::ZERO {
|
||||
if let Ok(mut player_transform) = q_player.get_single_mut() {
|
||||
player_transform.translation +=
|
||||
direction.normalize() * PLAYER_SPEED * time.delta_seconds();
|
||||
}
|
||||
let mut player_transform = q_player.get_single_mut().unwrap();
|
||||
player_transform.translation += direction.normalize() * PLAYER_SPEED * time.delta_seconds();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue