Use extend to convert vec2 to vec3

This commit is contained in:
Daniel Flanagan 2023-12-20 18:18:34 -06:00
parent 1c787d17ff
commit 4371f02949
Signed by: lytedev
GPG key ID: 5B2020A0F9921EF4

View file

@ -34,7 +34,6 @@ impl Plugin for MovementPlugin {
fn update_position(mut query: Query<(&Velocity, &mut Transform)>, time: Res<Time>) {
for (velocity, mut transform) in query.iter_mut() {
// TODO: convert vec2 to vec3 with a zero Z value?
transform.translation += velocity.0 * time.delta_seconds();
transform.translation += (velocity.0 * time.delta_seconds()).extend(0.);
}
}